flasgger / flasgger

Easy OpenAPI specs and Swagger UI for your Flask API

Home Page:http://flasgger.pythonanywhere.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I protect the swagger endpoints, by making it a child of another existing endpoint?

flixman opened this issue · comments

I have an application, flask, that contains all the api endpoints below /api/. as a before_request on the api blueprint I am making the validation of credentials, tokens, etc. I would like to set swagger to be a child of that /api/, so that whenever a request comes for it the credentials are also checked.

I have been reading the documentation but, in case this is possible, I have not been able to spot it. Can somebody give me a hand on this?

I have seen that the recommended way is to declare a decorator when initializing the app, that will perform the authentication checks.