-
Notifications
You must be signed in to change notification settings - Fork 155
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
Exclude OPTIONS method from operation list #112
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #112 +/- ##
=======================================
Coverage 97.64% 97.64%
=======================================
Files 8 8
Lines 339 339
=======================================
Hits 331 331
Misses 8 8
Continue to review full report at Codecov.
|
“OPTIONS is a promising idea that nobody uses.” maybe a slightly "better" option would be to add a configuration option to exclude it, some people may indeed like the idea of having it enabled as a self referencing tool. |
as per Flask doc in routes registration:
you just pass provide_automatic_options=False in your route and options disappear |
OPTIONS endpoints are absolutely valid to have in a spec. This would be a breaking change and should be avoided. Adding an option to the |
I think CORS gives people a legitimate reason for excluding OPTIONS requests from the swagger specification while still having Flask automatically generate them. I have taken a stab at implementing this as an optional feature by adding a parameter to the FlaskApiSpec constructor. Take a look at my PR #123, where I have also elaborated further on my reasoning. |
Any issues merging this? |
Hello from multiple years in the future! Looks like this was addressed (and merged) in #123 Now, it's possible to pass an argument Perhaps this issue can be closed now? |
I have the problem with every endpoint, the OPTIONS method is auto created and showing in Swagger UI.
Options method is rarely used for creating REST API so it is good to ignore this.
Flask endpoint always gives (HEAD, OPTIONS) method by default.