docs, cli: enforce package-bound docs, add template scaffolding, and document CLI usage

- Restrict mkdocstrings generation to real Python packages (require __init__.py)
- Add explicit documentation section for CLI scaffolding and templates
- Generalize CLI to support multiple templates with dynamic discovery
- Package templates correctly for importlib.resources access
- Add fully documented health_app template (app entry point and handlers)
- Fix setuptools package-data configuration for bundled templates

These changes make documentation import-safe, clarify package boundaries,
and provide a deterministic, OpenAPI-first scaffolding workflow via CLI.
This commit is contained in:
2026-01-11 19:26:21 +05:30
parent 6180443327
commit 72b5be6976
13 changed files with 273 additions and 74 deletions

View File

@@ -1,2 +1,32 @@
"""
OpenAPI operation handlers.
This module defines pure Python callables that implement OpenAPI
operations for this service. Functions in this module are bound to HTTP
routes exclusively via OpenAPI ``operationId`` values.
No routing decorators, HTTP metadata, or framework-specific logic
should appear here. All request/response semantics are defined in the
OpenAPI specification.
This module serves solely as an operationId namespace.
"""
def get_health():
"""
Health check operation handler.
This function implements the OpenAPI operation identified by
``operationId: get_health``.
It contains no routing metadata or framework-specific logic.
Request binding, HTTP method, and response semantics are defined
exclusively by the OpenAPI specification.
Returns
-------
dict
A minimal liveness payload indicating service health.
"""
return {"status": "ok"}