flask-openapi3
flask-openapi3 copied to clipboard
Manual registration of custom component schemas without route definition
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 :-)
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.