-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Multi-Responders with the same method type #30
base: master
Are you sure you want to change the base?
Conversation
Feature/multi methods per resource
Remove contraint on route naming
@alysivji it'd be nice if you could look into this PR or the others related to this feature, I believe it's a much needed improvement to the package (still had a friend/colleague last week asking for it and had to point him to my fork). |
@alysivji Can we please get some attention for this PR? This is a very common use case in falcon for collection/singleton resource strategies. |
This is my take on this feature about supporting multiple routes/Falcon responders, some of which may be suffixed and use the same HTTP method type, e.g. on_get and on_get_hello.
The plugin is still immutable when parsing the uris, and the only constraint for the user who wants to expose the docstring for all the routes is to register the path for all the suffixes just like in ebensonwwg's PR, but specifically passing this suffix. This does not look as "weird" as N+1 identical lines, and allows for selecting the suffix'ed methods to be registered.
As mentioned here, APISpec registers one and only one path per spec.path() call, and a path cannot have multiple GETs or POSTs, so we're kind of doomed to call spec.path() multiple times.
As a bonus I also improved the tox configuration, and used bump2version to easily bump new releases.