On Thu, Apr 16 2015, Jay Pipes wrote:

>> I think this may be the way to go. The intent of WSME is admirable
>> (the multiprotocol stack) but the execution leads to unwarranted
>> complexity.
>>
>> I think a framework more specifically dedicated to JSON APIs, or
>> even just being "webby" and correct would be better. Something
>> _much_ simpler and _much_ more aligned with WSGI.
>
> Amen. Honestly, I never liked WSME and now that projects are no longer
> supporting XML, I don't see any reason to continue using it.

Yeah, supporting XML was one of the good point of WSME… back then and a
reason to pick it… back then.

> Like you say, it adds way too much unnecessary complexity to the API
> framework, IMHO. Better to just use a simple JSONSchema framework
> (using the jsonschema Python library) to do input validations and have
> schema definitions in JSONSchema instead of random attribute factories
> like:

In Gnocchi we rely on voluptuous¹. The good part is that it allows to
write shorter and more Pythonic schema. The downside might be that it's
not portable obviously.

> Personally, I prefer the Falcon approach to routing, which is what I call
> "explicit object dispatch" ;)
>
> class ThingsResource:
>
>     def on_get(self, req, resp, user_id):
>         ... do some stuff
>         resp.set_header('X-Powered-By', 'Small Furry Creatures')
>         resp.status = falcon.HTTP_200
>
> things = ThingsResource()
> app = falcon.API()
> app.add_route('/{user_id}/things', things)

After using Pecan for a while, I'm leaning toward explicit routing too.
This Falcon API looks right too.
Honestly Pecan is messy. Most of the time, when coding, you have no clue
which one of the method is going to be picked in which controller class.

Cheers,
-- 
Julien Danjou
-- Free Software hacker
-- http://julien.danjou.info

Attachment: signature.asc
Description: PGP signature

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to