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:
@@ -49,6 +49,32 @@ Runtime dependencies are intentionally minimal:
|
||||
The ASGI server (e.g., uvicorn) is an application-level dependency and is
|
||||
not bundled with this library.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Command-Line Interface (Scaffolding, Templates)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
FastAPI OpenAPI First ships with a small CLI for bootstrapping
|
||||
OpenAPI-first FastAPI applications from bundled templates.
|
||||
|
||||
List available application templates:
|
||||
|
||||
openapi-first --list
|
||||
|
||||
Create a new application using the default template:
|
||||
|
||||
openapi-first
|
||||
|
||||
Create a new application using a specific template:
|
||||
|
||||
openapi-first health_app
|
||||
|
||||
Create a new application in a custom directory:
|
||||
|
||||
openapi-first health_app my-service
|
||||
|
||||
The CLI copies template files verbatim into the target directory.
|
||||
No code is generated or modified beyond the copied scaffold.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Server-Side Usage (OpenAPI → FastAPI)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user