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

Manual registration of custom component schemas without route definition #181

Open
marcuslary opened this issue Oct 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@marcuslary
Copy link

I'm looking for a way to manually register a component schema by providing a pydantic dto without using a route definition. Searched and played around a bit, but couldn't figure out how to do it. Is this supported in any way by the library? Thanks :-)

@marcuslary marcuslary added the bug Something isn't working label Oct 1, 2024
@luolingchun
Copy link
Owner

The OpenAPI class defines two global variables self.components_schemas and self.spec_json.

All the model schemas are stored self.components_schemas and the final specification documents are stored self.spec_json.

I think you can manually update these two variables to achieve your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants