docs(templates): document CRUD and model CRUD apps and expose them in mkdocs
- Add comprehensive module and function docstrings to crud_app and model_app templates - Document OpenAPI-first guarantees, non-goals, and usage patterns in templates - Add template-level __init__.py files with CLI and client usage examples - Update mkdocs.yml to include CRUD and model-based CRUD template documentation - Ensure template documentation follows strict package-bound mkdocstrings rules
This commit is contained in:
@@ -1,3 +1,30 @@
|
||||
"""
|
||||
Application entry point for an OpenAPI-first CRUD example service.
|
||||
|
||||
This module constructs a FastAPI application exclusively from an
|
||||
OpenAPI specification and a handler namespace, without using
|
||||
decorator-driven routing.
|
||||
|
||||
All HTTP routes, methods, request/response schemas, and operation
|
||||
bindings are defined in the OpenAPI document referenced by
|
||||
``openapi_path``. Python callables defined in the ``routes`` module are
|
||||
bound to OpenAPI operations strictly via ``operationId``.
|
||||
|
||||
This module contains no routing logic, persistence concerns, or
|
||||
framework configuration beyond application assembly.
|
||||
|
||||
Design guarantees:
|
||||
- OpenAPI is the single source of truth
|
||||
- No undocumented routes can exist
|
||||
- Every OpenAPI operationId must resolve to exactly one handler
|
||||
- All contract violations fail at application startup
|
||||
|
||||
This file is intended to be used as the ASGI entry point.
|
||||
|
||||
Example:
|
||||
uvicorn main:app
|
||||
"""
|
||||
|
||||
from openapi_first.app import OpenAPIFirstApp
|
||||
import routes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user