flask-openapi3 icon indicating copy to clipboard operation
flask-openapi3 copied to clipboard

Manual registration of custom component schemas without route definition

Open marcuslary opened this issue 1 year ago • 1 comments

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 avatar Oct 01 '24 13:10 marcuslary

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.

luolingchun avatar Oct 03 '24 02:10 luolingchun