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

Exclude routes from OpenAPI spec #301

Open
and3rson opened this issue Apr 19, 2023 · 1 comment
Open

Exclude routes from OpenAPI spec #301

and3rson opened this issue Apr 19, 2023 · 1 comment

Comments

@and3rson
Copy link

and3rson commented Apr 19, 2023

By default, all routes that are defined in Starlette application are included in the OpenAPI schema. Is it possible to specifically exclude some of them?
EDIT: Seems like overriding bypass method can do this, but it would be nice if @spectree.validate() allowed to mark method for exclusion from the OpenAPI schema.

@kemingy
Copy link
Member

kemingy commented Apr 20, 2023

Refer to

mode: ModeEnum = ModeEnum.normal

You can use spec = SpecTree(mode='strict') to indicate that only the decorated route will be included.

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

No branches or pull requests

2 participants