docs: add OpenAPI-first wiki (overview, components, use cases for templates/client/codegen, design, security, error handling, testing) and refresh lib docs index
This commit is contained in:
@@ -70,6 +70,23 @@ class OpenAPIFirstApp(FastAPI):
|
||||
"""
|
||||
FastAPI application enforcing OpenAPI-first design.
|
||||
|
||||
Args:
|
||||
openapi_path (str):
|
||||
Filesystem path to the OpenAPI 3.x specification file. This
|
||||
specification is treated as the authoritative API contract.
|
||||
routes_module (ModuleType):
|
||||
Python module containing handler functions whose names correspond
|
||||
exactly to OpenAPI ``operationId`` values.
|
||||
**fastapi_kwargs (Any):
|
||||
Additional keyword arguments passed directly to
|
||||
``fastapi.FastAPI`` (e.g., title, version, middleware, lifespan
|
||||
handlers).
|
||||
|
||||
Raises:
|
||||
OpenAPIFirstError:
|
||||
If the OpenAPI specification is invalid, or if any declared
|
||||
``operationId`` does not have a corresponding handler function.
|
||||
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
@@ -92,7 +109,7 @@ class OpenAPIFirstApp(FastAPI):
|
||||
|
||||
Example:
|
||||
```python
|
||||
from openapi_first import OpenAPIFirstApp
|
||||
from openapi_first.app import OpenAPIFirstApp
|
||||
import app.routes as routes
|
||||
|
||||
app = OpenAPIFirstApp(
|
||||
@@ -110,26 +127,6 @@ class OpenAPIFirstApp(FastAPI):
|
||||
routes_module: ModuleType,
|
||||
**fastapi_kwargs: Any,
|
||||
):
|
||||
"""
|
||||
Initialize the application.
|
||||
|
||||
Args:
|
||||
openapi_path (str):
|
||||
Filesystem path to the OpenAPI 3.x specification file. This
|
||||
specification is treated as the authoritative API contract.
|
||||
routes_module (ModuleType):
|
||||
Python module containing handler functions whose names correspond
|
||||
exactly to OpenAPI ``operationId`` values.
|
||||
**fastapi_kwargs (Any):
|
||||
Additional keyword arguments passed directly to
|
||||
``fastapi.FastAPI`` (e.g., title, version, middleware, lifespan
|
||||
handlers).
|
||||
|
||||
Raises:
|
||||
OpenAPIFirstError:
|
||||
If the OpenAPI specification is invalid, or if any declared
|
||||
``operationId`` does not have a corresponding handler function.
|
||||
"""
|
||||
# Initialize FastAPI normally
|
||||
super().__init__(**fastapi_kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user