Skip to content
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

Excluding certain blueprints from auto-generated docs #376

Open
reederz opened this issue Jul 21, 2022 · 2 comments
Open

Excluding certain blueprints from auto-generated docs #376

reederz opened this issue Jul 21, 2022 · 2 comments

Comments

@reederz
Copy link

reederz commented Jul 21, 2022

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.

@lafrech
Copy link
Member

lafrech commented Jul 27, 2022

There is no officially supported way to achieve this.

Related to #110 and #277. Perhaps a common solution ought to be offered.

@pmdarrow
Copy link

pmdarrow commented Oct 26, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants