A code generator that creates FastAPI applications from OpenAPI specification files.
fastapi-code-generator is a Python tool that automatically creates FastAPI application code from OpenAPI specification files. It reads an OpenAPI YAML or JSON file and generates corresponding FastAPI routes, endpoint functions, and Pydantic data models, solving the problem of manually translating API specifications into boilerplate code.
Backend developers and teams building FastAPI-based services who want to accelerate development by generating code from existing OpenAPI specifications.
Developers choose fastapi-code-generator because it eliminates manual coding errors, ensures the implementation matches the specification exactly, and significantly reduces development time for FastAPI projects that start with an OpenAPI design.
This code generator creates FastAPI app from an openapi file.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Directly generates FastAPI routes and Pydantic models from OpenAPI 3.0 files, reducing manual boilerplate and ensuring consistency with the API design.
Supports creating multiple routers based on OpenAPI tags, facilitating organized code for larger applications, as shown in the example with separate router files.
Allows the use of custom Jinja2 templates to tailor generated code structure, providing control over output for specific project needs.
Supports both Pydantic v1 and v2 via command-line options, ensuring it can adapt to different project dependencies.
The README explicitly states the project is in an experimental phase, meaning it may have bugs, incomplete features, or breaking changes unsuitable for production.
Generates endpoint stubs with 'pass' statements, requiring developers to manually implement all business logic, which can be time-consuming for complex APIs.
Does not automatically handle OpenAPI elements like security schemas, authentication, or custom middleware, limiting out-of-the-box functionality for secure or intricate APIs.