flask-smorest
flask-smorest copied to clipboard
Excluding certain blueprints from auto-generated docs
I have an app, with two separate REST APIs - private api and public api. Is there a way to mark certain blueprints to be blacklisted from auto-generated docs?
I found that I can register my private api blueprints directly on flask app instead of flask_smorest.Api instance, but I am unsure if this will break something.
There is no officially supported way to achieve this.
Related to #110 and #277. Perhaps a common solution ought to be offered.
@reederz (or any others that come across this) - I've written a helper that enables flask-smorest routes decorated with a @public_docs decorator to be rendered in a separate OpenAPI spec. It basically processes the output of flask openapi write openapi.json and creates a new spec with just the endpoints (and their related schemas) that have the x-public property. See the implementation here.