[openstack-dev] [api] API Definition Formats

Chris Dent chdent at redhat.com
Wed Feb 4 14:30:54 UTC 2015


On Mon, 2 Feb 2015, Chris Dent wrote:

> On Thu, 29 Jan 2015, michael mccune wrote:
>
>> in a similar vein, i started to work on marking up the sahara and barbican 
>> code bases to produce swagger. for sahara this was a little easier as flask 
>> makes it simple to query the paths. for barbican i started a 
>> pecan-swagger[1] project to aid in marking up the code. it's still in 
>> infancy but i have a few ideas.
>
> pecan-swagger looks cool but presumably pecan has most of the info
> you're putting in the decorators in itself already? So, given an
> undecorated pecan app, would it be possible to provide it to a function
> and have that function output all the paths?

(Following up for sake of completeness.)

I did some digging around pecan today and as far as I can pecan
itself doesn't directly know its available paths. I had assumed that
when it loaded itself up it traversed the available controllers and
created a routing table that is then used henceforth for dispatch.
Turns out this is not the case. Instead for every incoming path it
does a lookup, traversing the classes that make up the app,
descending the tree as the path matches.

Presumably one could write code to do this traversal but I had
thought (hoped) it would be easier than that: just access the data
structure not create it.

-- 
Chris Dent tw:@anticdent freenode:cdent
https://tank.peermore.com/tanks/cdent



More information about the OpenStack-dev mailing list