This code generator creates FastAPI app from an openapi file.
This code generator creates FastAPI app from an openapi file.
Generate a FastAPI application from an OpenAPI document.
Maintainer update: Open to opportunities. koxudaxi.dev
The docs site is the source of truth for user-facing documentation:
Use this README as a quick start. The full examples, templating details, and development workflow live in docs/.
uv tool install fastapi-code-generatorpip install fastapi-code-generatorfastapi-codegen --input openapi.yaml --output app --output-model-type pydantic_v2.BaseModelfastapi-code-generator uses datamodel-code-generator to build the model layer. See the overview guide for a complete end-to-end example, custom templates, custom visitors, and router generation.
This block is generated from the current CLI so the README and docs overview stay aligned. For tested option scenarios and examples, use the CLI reference page.
…fastapi-codegen --input openapi.yaml --output appfastapi-codegen --input openapi.yaml --output app --template-dir modular_template --generate-routersfastapi-codegen --input openapi.yaml --output app --template-dir modular_template --generate-routers --specify-tags "Wild Boars, Fat Cats"fastapi-codegen --input openapi.yaml --output app --output-model-type pydantic_v2.BaseModelNo open issues yet, or sync has not completed.