-
Notifications
You must be signed in to change notification settings - Fork 39
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
allow specifying swagger documents for path converters #295
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but would love to see a test and/or example of this in the docs.
without much changing elsewhere, this allows us to set enum types for custom path converters in flask. for example: `/v1/preferences/<preference_type:scope>` where scope could be `user`, `project`, or `account`. We can define an object with a `to_swagger` function as part of the [Flask Converter](https://flask.palletsprojects.com/en/2.3.x/api/#flask.Flask.url_map) that is defined.
c3e3c67
to
6556066
Compare
ok @airstandley I have gotten around to adding documentation and tests :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Looks brilliant, thanks for adding the tests and docs!
|
||
rebar = Rebar() | ||
registry = rebar.create_handler_registry() | ||
|
||
|
||
class UUIDPathConverter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
without much changing elsewhere, this allows us to set enum types for custom path converters in flask.
for example:
/v1/preferences/<preference_type:scope>
where scope could beuser
,project
, oraccount
. We can define an object with ato_swagger
function as part of the Flask Converter that is defined.