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

[feature] Build without OpenAPI spec #139

Open
Hybridlo opened this issue Nov 28, 2024 · 1 comment
Open

[feature] Build without OpenAPI spec #139

Hybridlo opened this issue Nov 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Hybridlo
Copy link

Use case:
In my project I want to be able to generate the OpenAPI spec in development builds for internal use, but not expose it in production.

Currently this is almost impossible, since .build and .build_with functions force having openapi route(s), without the ability to remove or even limit access to that specific route with middleware.
My current solution is to use global middleware that checks every request, and limits access only to specified routes - openapi spec and swagger ui in my particular case

Alternatively there could be a way to add middlewares to apistos-generated routes, which might cover more use cases, provided such use cases exists and that would probably be a more complicated feature to implement

@rlebran
Copy link
Contributor

rlebran commented Dec 21, 2024

Hi,

Thanks for the suggestion.
How do you plan on retrieving the generated OAS file if not exposing the routes ? Would you like to have a file generated somewhere, ideally at build time ?

@rlebran rlebran added the enhancement New feature or request label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants