Generate a FastAPI app from an OpenAPI file.
Archived. The repository is read-only: no more fixes or releases will come.
Consider insteadopenapi-generator-cliPythie’s Index: 88844.7K downloads/moCompare →
pip install fastapi-code-generatorfastapi-code-generator
Generate a FastAPI application from an OpenAPI document.
📣 💼 Maintainer update: Open to opportunities. 🔗 koxudaxi.dev
Documentation
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/.
Installation
uv tool install fastapi-code-generator
pip install fastapi-code-generator
Quick Start
fastapi-codegen --input openapi.yaml --output app --output-model-type pydantic_v2.BaseModel
fastapi-code-generator uses datamodel-code-generator to build the model layer. See the for a complete end-to-end example, custom templates, custom visitors, and router generation.