App
openapi_first.app
Summary
OpenAPI-first application bootstrap for FastAPI.
This module provides OpenAPIFirstApp, a thin but strict abstraction
that enforces OpenAPI as the single source of truth for a FastAPI service.
Notes
Core Principles:
1 2 3 4 5 6 | |
Responsibilities:
1 2 3 4 | |
Constraints:
1 2 3 4 5 | |
Classes
OpenAPIFirstApp
Bases: FastAPI
FastAPI application enforcing OpenAPI-first design.
Notes
Responsibilities:
1 2 3 4 5 | |
Guarantees:
1 2 3 4 | |
Example
Initialize the application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
openapi_path |
str
|
Filesystem path to the OpenAPI 3.x specification file. This specification is treated as the authoritative API contract. |
required |
routes_module |
module
|
Python module containing handler functions whose names correspond
exactly to OpenAPI |
required |
**fastapi_kwargs |
Any
|
Additional keyword arguments passed directly to
|
{}
|
Raises:
| Type | Description |
|---|---|
OpenAPIFirstError
|
If the OpenAPI specification is invalid, or if any declared
|