You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These changes add a new optional parameter called `document_options`
to the FlaskApiSpec constructor that will exclude OPTIONS requests
from the swagger specification if set to `False`.
Flask automatically generates OPTIONS requests for each route. There are
cases, such as when using CORS, where one would want these OPTIONS
requests to be generated but do not want to have them in their swagger
docs.
My line of reasoning for wanting to exclude these is: My API users
will never explicitly make an OPTIONS request. The browser will
automatically send a pre-flight OPTIONS request when making a
cross-origin request, and I want to have OPTIONS endpoints in order
to support that, but I don't want to have this functionality adding
a bunch of endpoints to my swagger docs which will largely be ignored
by users.
0 commit comments