From 658a98cf1966c663da671df283cd0911630adf48 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Thu, 10 Sep 2026 21:15:05 +0530 Subject: [PATCH] docs: nest generated docs under docs/lib and docs/mcp --- docs/{ => lib}/app.md | 0 docs/{ => lib}/binder.md | 0 docs/{ => lib}/cli.md | 0 docs/{ => lib}/client.md | 0 docs/lib/codegen.md | 3 + docs/lib/codegen_routes.md | 3 + docs/{ => lib}/errors.md | 0 docs/{ => lib}/index.md | 0 docs/{ => lib}/loader.md | 0 docs/lib/security.md | 3 + docs/{ => lib}/templates/crud_app/data.md | 0 docs/{ => lib}/templates/crud_app/index.md | 0 docs/{ => lib}/templates/crud_app/main.md | 0 docs/{ => lib}/templates/crud_app/routes.md | 0 .../templates/crud_app/test_crud_app.md | 0 docs/{ => lib}/templates/health_app/index.md | 0 docs/{ => lib}/templates/health_app/main.md | 0 docs/{ => lib}/templates/health_app/routes.md | 0 docs/{ => lib}/templates/index.md | 0 docs/{ => lib}/templates/model_app/data.md | 0 docs/{ => lib}/templates/model_app/index.md | 0 docs/{ => lib}/templates/model_app/main.md | 0 docs/{ => lib}/templates/model_app/models.md | 0 docs/{ => lib}/templates/model_app/routes.md | 0 .../templates/model_app/test_model_app.md | 0 docs/lib/templates/vet_app/data.md | 3 + docs/lib/templates/vet_app/index.md | 3 + docs/lib/templates/vet_app/main.md | 3 + docs/lib/templates/vet_app/models.md | 3 + docs/lib/templates/vet_app/routes.md | 3 + docs/lib/templates/vet_app/sse.md | 3 + docs/lib/templates/vet_app/test_vet_app.md | 3 + {mcp_docs => docs/mcp}/index.json | 2 +- .../mcp}/modules/openapi_first.app.json | 42 +- .../mcp}/modules/openapi_first.binder.json | 25 +- .../mcp}/modules/openapi_first.cli.json | 20 +- .../mcp}/modules/openapi_first.client.json | 34 +- docs/mcp/modules/openapi_first.codegen.json | 51 + .../modules/openapi_first.codegen_routes.json | 37 + .../mcp}/modules/openapi_first.errors.json | 11 +- docs/mcp/modules/openapi_first.json | 2830 +++++++++++++++++ .../mcp}/modules/openapi_first.loader.json | 18 +- docs/mcp/modules/openapi_first.security.json | 93 + ...openapi_first.templates.crud_app.data.json | 0 .../openapi_first.templates.crud_app.json | 2 +- ...openapi_first.templates.crud_app.main.json | 2 +- ...enapi_first.templates.crud_app.routes.json | 0 ...irst.templates.crud_app.test_crud_app.json | 0 .../openapi_first.templates.health_app.json | 2 +- ...enapi_first.templates.health_app.main.json | 2 +- ...api_first.templates.health_app.routes.json | 0 docs/mcp/modules/openapi_first.templates.json | 2274 +++++++++++++ ...penapi_first.templates.model_app.data.json | 0 .../openapi_first.templates.model_app.json | 2 +- ...penapi_first.templates.model_app.main.json | 2 +- ...napi_first.templates.model_app.models.json | 0 ...napi_first.templates.model_app.routes.json | 0 ...st.templates.model_app.test_model_app.json | 0 .../openapi_first.templates.vet_app.data.json | 324 ++ .../openapi_first.templates.vet_app.json | 1572 +++++++++ .../openapi_first.templates.vet_app.main.json | 60 + ...penapi_first.templates.vet_app.models.json | 681 ++++ ...penapi_first.templates.vet_app.routes.json | 275 ++ .../openapi_first.templates.vet_app.sse.json | 44 + ..._first.templates.vet_app.test_vet_app.json | 179 ++ {mcp_docs => docs/mcp}/nav.json | 40 + mcp_docs/modules/openapi_first.json | 1091 ------- mcp_docs/modules/openapi_first.templates.json | 702 ---- mkdocs.yml | 1 + 69 files changed, 8566 insertions(+), 1882 deletions(-) rename docs/{ => lib}/app.md (100%) rename docs/{ => lib}/binder.md (100%) rename docs/{ => lib}/cli.md (100%) rename docs/{ => lib}/client.md (100%) create mode 100644 docs/lib/codegen.md create mode 100644 docs/lib/codegen_routes.md rename docs/{ => lib}/errors.md (100%) rename docs/{ => lib}/index.md (100%) rename docs/{ => lib}/loader.md (100%) create mode 100644 docs/lib/security.md rename docs/{ => lib}/templates/crud_app/data.md (100%) rename docs/{ => lib}/templates/crud_app/index.md (100%) rename docs/{ => lib}/templates/crud_app/main.md (100%) rename docs/{ => lib}/templates/crud_app/routes.md (100%) rename docs/{ => lib}/templates/crud_app/test_crud_app.md (100%) rename docs/{ => lib}/templates/health_app/index.md (100%) rename docs/{ => lib}/templates/health_app/main.md (100%) rename docs/{ => lib}/templates/health_app/routes.md (100%) rename docs/{ => lib}/templates/index.md (100%) rename docs/{ => lib}/templates/model_app/data.md (100%) rename docs/{ => lib}/templates/model_app/index.md (100%) rename docs/{ => lib}/templates/model_app/main.md (100%) rename docs/{ => lib}/templates/model_app/models.md (100%) rename docs/{ => lib}/templates/model_app/routes.md (100%) rename docs/{ => lib}/templates/model_app/test_model_app.md (100%) create mode 100644 docs/lib/templates/vet_app/data.md create mode 100644 docs/lib/templates/vet_app/index.md create mode 100644 docs/lib/templates/vet_app/main.md create mode 100644 docs/lib/templates/vet_app/models.md create mode 100644 docs/lib/templates/vet_app/routes.md create mode 100644 docs/lib/templates/vet_app/sse.md create mode 100644 docs/lib/templates/vet_app/test_vet_app.md rename {mcp_docs => docs/mcp}/index.json (78%) rename {mcp_docs => docs/mcp}/modules/openapi_first.app.json (57%) rename {mcp_docs => docs/mcp}/modules/openapi_first.binder.json (76%) rename {mcp_docs => docs/mcp}/modules/openapi_first.cli.json (96%) rename {mcp_docs => docs/mcp}/modules/openapi_first.client.json (89%) create mode 100644 docs/mcp/modules/openapi_first.codegen.json create mode 100644 docs/mcp/modules/openapi_first.codegen_routes.json rename {mcp_docs => docs/mcp}/modules/openapi_first.errors.json (87%) create mode 100644 docs/mcp/modules/openapi_first.json rename {mcp_docs => docs/mcp}/modules/openapi_first.loader.json (89%) create mode 100644 docs/mcp/modules/openapi_first.security.json rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.crud_app.data.json (100%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.crud_app.json (96%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.crud_app.main.json (79%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.crud_app.routes.json (100%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.crud_app.test_crud_app.json (100%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.health_app.json (90%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.health_app.main.json (79%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.health_app.routes.json (100%) create mode 100644 docs/mcp/modules/openapi_first.templates.json rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.model_app.data.json (100%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.model_app.json (97%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.model_app.main.json (79%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.model_app.models.json (100%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.model_app.routes.json (100%) rename {mcp_docs => docs/mcp}/modules/openapi_first.templates.model_app.test_model_app.json (100%) create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.data.json create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.json create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.main.json create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.models.json create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.routes.json create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.sse.json create mode 100644 docs/mcp/modules/openapi_first.templates.vet_app.test_vet_app.json rename {mcp_docs => docs/mcp}/nav.json (68%) delete mode 100644 mcp_docs/modules/openapi_first.json delete mode 100644 mcp_docs/modules/openapi_first.templates.json diff --git a/docs/app.md b/docs/lib/app.md similarity index 100% rename from docs/app.md rename to docs/lib/app.md diff --git a/docs/binder.md b/docs/lib/binder.md similarity index 100% rename from docs/binder.md rename to docs/lib/binder.md diff --git a/docs/cli.md b/docs/lib/cli.md similarity index 100% rename from docs/cli.md rename to docs/lib/cli.md diff --git a/docs/client.md b/docs/lib/client.md similarity index 100% rename from docs/client.md rename to docs/lib/client.md diff --git a/docs/lib/codegen.md b/docs/lib/codegen.md new file mode 100644 index 0000000..44b1cdc --- /dev/null +++ b/docs/lib/codegen.md @@ -0,0 +1,3 @@ +# Codegen + +::: openapi_first.codegen diff --git a/docs/lib/codegen_routes.md b/docs/lib/codegen_routes.md new file mode 100644 index 0000000..3301add --- /dev/null +++ b/docs/lib/codegen_routes.md @@ -0,0 +1,3 @@ +# Codegen Routes + +::: openapi_first.codegen_routes diff --git a/docs/errors.md b/docs/lib/errors.md similarity index 100% rename from docs/errors.md rename to docs/lib/errors.md diff --git a/docs/index.md b/docs/lib/index.md similarity index 100% rename from docs/index.md rename to docs/lib/index.md diff --git a/docs/loader.md b/docs/lib/loader.md similarity index 100% rename from docs/loader.md rename to docs/lib/loader.md diff --git a/docs/lib/security.md b/docs/lib/security.md new file mode 100644 index 0000000..3a8a166 --- /dev/null +++ b/docs/lib/security.md @@ -0,0 +1,3 @@ +# Security + +::: openapi_first.security diff --git a/docs/templates/crud_app/data.md b/docs/lib/templates/crud_app/data.md similarity index 100% rename from docs/templates/crud_app/data.md rename to docs/lib/templates/crud_app/data.md diff --git a/docs/templates/crud_app/index.md b/docs/lib/templates/crud_app/index.md similarity index 100% rename from docs/templates/crud_app/index.md rename to docs/lib/templates/crud_app/index.md diff --git a/docs/templates/crud_app/main.md b/docs/lib/templates/crud_app/main.md similarity index 100% rename from docs/templates/crud_app/main.md rename to docs/lib/templates/crud_app/main.md diff --git a/docs/templates/crud_app/routes.md b/docs/lib/templates/crud_app/routes.md similarity index 100% rename from docs/templates/crud_app/routes.md rename to docs/lib/templates/crud_app/routes.md diff --git a/docs/templates/crud_app/test_crud_app.md b/docs/lib/templates/crud_app/test_crud_app.md similarity index 100% rename from docs/templates/crud_app/test_crud_app.md rename to docs/lib/templates/crud_app/test_crud_app.md diff --git a/docs/templates/health_app/index.md b/docs/lib/templates/health_app/index.md similarity index 100% rename from docs/templates/health_app/index.md rename to docs/lib/templates/health_app/index.md diff --git a/docs/templates/health_app/main.md b/docs/lib/templates/health_app/main.md similarity index 100% rename from docs/templates/health_app/main.md rename to docs/lib/templates/health_app/main.md diff --git a/docs/templates/health_app/routes.md b/docs/lib/templates/health_app/routes.md similarity index 100% rename from docs/templates/health_app/routes.md rename to docs/lib/templates/health_app/routes.md diff --git a/docs/templates/index.md b/docs/lib/templates/index.md similarity index 100% rename from docs/templates/index.md rename to docs/lib/templates/index.md diff --git a/docs/templates/model_app/data.md b/docs/lib/templates/model_app/data.md similarity index 100% rename from docs/templates/model_app/data.md rename to docs/lib/templates/model_app/data.md diff --git a/docs/templates/model_app/index.md b/docs/lib/templates/model_app/index.md similarity index 100% rename from docs/templates/model_app/index.md rename to docs/lib/templates/model_app/index.md diff --git a/docs/templates/model_app/main.md b/docs/lib/templates/model_app/main.md similarity index 100% rename from docs/templates/model_app/main.md rename to docs/lib/templates/model_app/main.md diff --git a/docs/templates/model_app/models.md b/docs/lib/templates/model_app/models.md similarity index 100% rename from docs/templates/model_app/models.md rename to docs/lib/templates/model_app/models.md diff --git a/docs/templates/model_app/routes.md b/docs/lib/templates/model_app/routes.md similarity index 100% rename from docs/templates/model_app/routes.md rename to docs/lib/templates/model_app/routes.md diff --git a/docs/templates/model_app/test_model_app.md b/docs/lib/templates/model_app/test_model_app.md similarity index 100% rename from docs/templates/model_app/test_model_app.md rename to docs/lib/templates/model_app/test_model_app.md diff --git a/docs/lib/templates/vet_app/data.md b/docs/lib/templates/vet_app/data.md new file mode 100644 index 0000000..1117bf0 --- /dev/null +++ b/docs/lib/templates/vet_app/data.md @@ -0,0 +1,3 @@ +# Data + +::: openapi_first.templates.vet_app.data diff --git a/docs/lib/templates/vet_app/index.md b/docs/lib/templates/vet_app/index.md new file mode 100644 index 0000000..d5993a3 --- /dev/null +++ b/docs/lib/templates/vet_app/index.md @@ -0,0 +1,3 @@ +# Vet App + +::: openapi_first.templates.vet_app diff --git a/docs/lib/templates/vet_app/main.md b/docs/lib/templates/vet_app/main.md new file mode 100644 index 0000000..e253dad --- /dev/null +++ b/docs/lib/templates/vet_app/main.md @@ -0,0 +1,3 @@ +# Main + +::: openapi_first.templates.vet_app.main diff --git a/docs/lib/templates/vet_app/models.md b/docs/lib/templates/vet_app/models.md new file mode 100644 index 0000000..d65ce55 --- /dev/null +++ b/docs/lib/templates/vet_app/models.md @@ -0,0 +1,3 @@ +# Models + +::: openapi_first.templates.vet_app.models diff --git a/docs/lib/templates/vet_app/routes.md b/docs/lib/templates/vet_app/routes.md new file mode 100644 index 0000000..8d99bc4 --- /dev/null +++ b/docs/lib/templates/vet_app/routes.md @@ -0,0 +1,3 @@ +# Routes + +::: openapi_first.templates.vet_app.routes diff --git a/docs/lib/templates/vet_app/sse.md b/docs/lib/templates/vet_app/sse.md new file mode 100644 index 0000000..6e3e4e4 --- /dev/null +++ b/docs/lib/templates/vet_app/sse.md @@ -0,0 +1,3 @@ +# Sse + +::: openapi_first.templates.vet_app.sse diff --git a/docs/lib/templates/vet_app/test_vet_app.md b/docs/lib/templates/vet_app/test_vet_app.md new file mode 100644 index 0000000..8aebee7 --- /dev/null +++ b/docs/lib/templates/vet_app/test_vet_app.md @@ -0,0 +1,3 @@ +# Test Vet App + +::: openapi_first.templates.vet_app.test_vet_app diff --git a/mcp_docs/index.json b/docs/mcp/index.json similarity index 78% rename from mcp_docs/index.json rename to docs/mcp/index.json index 893ef8d..badcdfc 100644 --- a/mcp_docs/index.json +++ b/docs/mcp/index.json @@ -1,6 +1,6 @@ { "project": "openapi_first", "type": "docforge-model", - "modules_count": 22, + "modules_count": 32, "source": "docforge" } \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.app.json b/docs/mcp/modules/openapi_first.app.json similarity index 57% rename from mcp_docs/modules/openapi_first.app.json rename to docs/mcp/modules/openapi_first.app.json index d614302..6ed98ac 100644 --- a/mcp_docs/modules/openapi_first.app.json +++ b/docs/mcp/modules/openapi_first.app.json @@ -4,6 +4,20 @@ "path": "openapi_first.app", "docstring": "# Summary\n\nOpenAPI-first application bootstrap for FastAPI.\n\nThis module provides `OpenAPIFirstApp`, a thin but strict abstraction\nthat enforces OpenAPI as the single source of truth for a FastAPI service.\n\nNotes:\n **Core Principles:**\n\n - The OpenAPI specification (JSON or YAML) defines the entire API surface.\n - Every `operationId` in the OpenAPI spec must have a corresponding\n Python handler function.\n - Handlers are plain Python callables (no FastAPI decorators).\n - FastAPI route registration is derived exclusively from the spec.\n - FastAPI's autogenerated OpenAPI schema is fully overridden.\n\n **Responsibilities:**\n\n - Loads and validates an OpenAPI 3.x specification.\n - Dynamically binds HTTP routes to handler functions using `operationId`.\n - Registers routes with FastAPI at application startup.\n - Ensures runtime behavior matches the OpenAPI contract exactly.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Generate OpenAPI specs.\n - Generate client code.\n - Introduce a new framework or lifecycle.\n - Alter FastAPI dependency injection semantics.", "objects": { + "os": { + "name": "os", + "kind": "alias", + "path": "openapi_first.app.os", + "signature": "", + "docstring": null + }, + "re": { + "name": "re", + "kind": "alias", + "path": "openapi_first.app.re", + "signature": "", + "docstring": null + }, "FastAPI": { "name": "FastAPI", "kind": "alias", @@ -11,6 +25,13 @@ "signature": "", "docstring": null }, + "bind_routes": { + "name": "bind_routes", + "kind": "function", + "path": "openapi_first.app.bind_routes", + "signature": "", + "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n security_deps (dict | None):\n Optional mapping of ``METHOD:/path`` → ``list[Depends(...)]``\n generated from the spec's ``securitySchemes`` and per-operation\n ``security`` fields.\n\nRaises:\n MissingOperationHandler:\n If an ``operationId`` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each ``operationId`` to a handler function, and registers\n a corresponding ``APIRoute`` on the FastAPI application.\n - Injects FastAPI ``Depends()`` for each security requirement found\n on the operation or inherited from the top-level ``security`` field.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." + }, "load_openapi": { "name": "load_openapi", "kind": "function", @@ -18,19 +39,26 @@ "signature": "", "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." }, - "bind_routes": { - "name": "bind_routes", + "make_security_dependencies": { + "name": "make_security_dependencies", "kind": "function", - "path": "openapi_first.app.bind_routes", - "signature": "", - "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n\nRaises:\n MissingOperationHandler:\n If an `operationId` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each `operationId` to a handler function, and registers\n a corresponding `APIRoute` on the FastAPI application.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." + "path": "openapi_first.app.make_security_dependencies", + "signature": "", + "docstring": "Build a mapping of ``METHOD:/path`` → list of ``Depends(...)``.\n\nThe effective security for each operation is resolved by:\n\n1. Using the operation-level ``security`` field if present.\n2. Falling back to the top-level ``security`` field.\n3. An empty list means *no auth required* for that operation." + }, + "parse_security_schemes": { + "name": "parse_security_schemes", + "kind": "function", + "path": "openapi_first.app.parse_security_schemes", + "signature": "", + "docstring": "Extract and resolve environment variables in security schemes." }, "OpenAPIFirstApp": { "name": "OpenAPIFirstApp", "kind": "class", "path": "openapi_first.app.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.binder.json b/docs/mcp/modules/openapi_first.binder.json similarity index 76% rename from mcp_docs/modules/openapi_first.binder.json rename to docs/mcp/modules/openapi_first.binder.json index 6ab8734..beb8d21 100644 --- a/mcp_docs/modules/openapi_first.binder.json +++ b/docs/mcp/modules/openapi_first.binder.json @@ -4,6 +4,13 @@ "path": "openapi_first.binder", "docstring": "# Summary\n\nOpenAPI-driven route binding for FastAPI.\n\nThis module is responsible for translating an OpenAPI 3.x specification\ninto concrete FastAPI routes. It enforces a strict one-to-one mapping\nbetween OpenAPI operations and Python handler functions using `operationId`.\n\nNotes:\n **Core Responsibility:**\n\n - Read path + method definitions from an OpenAPI specification.\n - Resolve each `operationId` to a Python callable.\n - Register routes with FastAPI using `APIRoute`.\n - Fail fast when contract violations are detected.\n\n **Design Constraints:**\n\n - All routes MUST be declared in the OpenAPI specification.\n - All OpenAPI operations MUST define an `operationId`.\n - Every `operationId` MUST resolve to a handler function.\n - Handlers are plain Python callables (no decorators required).\n - No implicit route creation or inference is allowed.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Perform request or response validation.\n - Generate Pydantic models.\n - Modify FastAPI dependency injection.\n - Interpret OpenAPI semantics beyond routing metadata.", "objects": { + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.binder.Any", + "signature": "", + "docstring": null + }, "APIRoute": { "name": "APIRoute", "kind": "alias", @@ -22,22 +29,8 @@ "name": "bind_routes", "kind": "function", "path": "openapi_first.binder.bind_routes", - "signature": "", - "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n\nRaises:\n MissingOperationHandler:\n If an `operationId` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each `operationId` to a handler function, and registers\n a corresponding `APIRoute` on the FastAPI application.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "openapi_first.binder.Any", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.binder.Dict", - "signature": "", - "docstring": null + "signature": "", + "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n security_deps (dict | None):\n Optional mapping of ``METHOD:/path`` → ``list[Depends(...)]``\n generated from the spec's ``securitySchemes`` and per-operation\n ``security`` fields.\n\nRaises:\n MissingOperationHandler:\n If an ``operationId`` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each ``operationId`` to a handler function, and registers\n a corresponding ``APIRoute`` on the FastAPI application.\n - Injects FastAPI ``Depends()`` for each security requirement found\n on the operation or inherited from the top-level ``security`` field.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." }, "FastAPI": { "name": "FastAPI", diff --git a/mcp_docs/modules/openapi_first.cli.json b/docs/mcp/modules/openapi_first.cli.json similarity index 96% rename from mcp_docs/modules/openapi_first.cli.json rename to docs/mcp/modules/openapi_first.cli.json index ae4e103..4ada4ed 100644 --- a/mcp_docs/modules/openapi_first.cli.json +++ b/docs/mcp/modules/openapi_first.cli.json @@ -18,13 +18,6 @@ "signature": "", "docstring": null }, - "Path": { - "name": "Path", - "kind": "alias", - "path": "openapi_first.cli.Path", - "signature": "", - "docstring": null - }, "resources": { "name": "resources", "kind": "alias", @@ -32,6 +25,13 @@ "signature": "", "docstring": null }, + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.cli.Path", + "signature": "", + "docstring": null + }, "DEFAULT_TEMPLATE": { "name": "DEFAULT_TEMPLATE", "kind": "attribute", @@ -43,21 +43,21 @@ "name": "available_templates", "kind": "function", "path": "openapi_first.cli.available_templates", - "signature": "", + "signature": "", "docstring": "Return a list of available application templates.\n\nReturns:\n list[str]:\n Sorted list of template names found in the internal templates directory." }, "copy_template": { "name": "copy_template", "kind": "function", "path": "openapi_first.cli.copy_template", - "signature": "", + "signature": "", "docstring": "Copy a bundled OpenAPI-first application template into a directory.\n\nArgs:\n template (str):\n Name of the template to copy.\n target_dir (Path):\n Filesystem path where the template should be copied.\n\nRaises:\n FileNotFoundError:\n If the requested template does not exist." }, "main": { "name": "main", "kind": "function", "path": "openapi_first.cli.main", - "signature": "", + "signature": "", "docstring": null } } diff --git a/mcp_docs/modules/openapi_first.client.json b/docs/mcp/modules/openapi_first.client.json similarity index 89% rename from mcp_docs/modules/openapi_first.client.json rename to docs/mcp/modules/openapi_first.client.json index 1dae514..91eb734 100644 --- a/mcp_docs/modules/openapi_first.client.json +++ b/docs/mcp/modules/openapi_first.client.json @@ -4,6 +4,13 @@ "path": "openapi_first.client", "docstring": "# Summary\n\nOpenAPI-first HTTP client for contract-driven services.\n\nThis module provides `OpenAPIClient`, a thin, strict HTTP client that\nderives all callable operations directly from an OpenAPI 3.x specification.\n\nIt is the client counterpart to `OpenAPIFirstApp`.\n\nNotes:\n **Core Principles:**\n\n - The OpenAPI specification is the single source of truth\n - Each operationId becomes a callable Python method\n - No implicit schema mutation or inference\n - No code generation step\n - Minimal abstraction over httpx\n\n **Responsibilities:**\n\n - Parses an OpenAPI 3.x specification\n - Dynamically creates one callable per operationId\n - Enforces presence of servers, paths, and operationId\n - Formats path parameters safely\n - Handles JSON request bodies explicitly\n - Returns raw `httpx.Response` objects\n\n **Constraints:**\n\n - This module intentionally does NOT: Generate client code, validate request/response schemas, deserialize responses, retry requests, implement authentication helpers, or assume non-2xx responses are failures.", "objects": { + "Callable": { + "name": "Callable", + "kind": "alias", + "path": "openapi_first.client.Callable", + "signature": "", + "docstring": null + }, "Any": { "name": "Any", "kind": "alias", @@ -11,27 +18,6 @@ "signature": "", "docstring": null }, - "Callable": { - "name": "Callable", - "kind": "alias", - "path": "openapi_first.client.Callable", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.client.Dict", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "openapi_first.client.Optional", - "signature": "", - "docstring": null - }, "urljoin": { "name": "urljoin", "kind": "alias", @@ -57,14 +43,14 @@ "name": "OpenAPIClientError", "kind": "class", "path": "openapi_first.client.OpenAPIClientError", - "signature": "", + "signature": "", "docstring": "Raised when an OpenAPI client operation fails." }, "OpenAPIClient": { "name": "OpenAPIClient", "kind": "class", "path": "openapi_first.client.OpenAPIClient", - "signature": "", + "signature": "", "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", "members": { "spec": { @@ -92,7 +78,7 @@ "name": "operations", "kind": "function", "path": "openapi_first.client.OpenAPIClient.operations", - "signature": "", + "signature": "", "docstring": null } } diff --git a/docs/mcp/modules/openapi_first.codegen.json b/docs/mcp/modules/openapi_first.codegen.json new file mode 100644 index 0000000..5fc9763 --- /dev/null +++ b/docs/mcp/modules/openapi_first.codegen.json @@ -0,0 +1,51 @@ +{ + "module": "openapi_first.codegen", + "content": { + "path": "openapi_first.codegen", + "docstring": "# Summary\n\nCore logic for generating Python source code from OpenAPI specifications.\n\nThis module provides reusable utilities for code generation, specifically\ngenerating Pydantic models and route handler stubs from OpenAPI 3.x schema\ndefinitions.", + "objects": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.codegen.Path", + "signature": "", + "docstring": null + }, + "InputFileType": { + "name": "InputFileType", + "kind": "alias", + "path": "openapi_first.codegen.InputFileType", + "signature": "", + "docstring": null + }, + "PythonVersion": { + "name": "PythonVersion", + "kind": "alias", + "path": "openapi_first.codegen.PythonVersion", + "signature": "", + "docstring": null + }, + "generate": { + "name": "generate", + "kind": "alias", + "path": "openapi_first.codegen.generate", + "signature": "", + "docstring": null + }, + "generate_routes": { + "name": "generate_routes", + "kind": "function", + "path": "openapi_first.codegen.generate_routes", + "signature": "", + "docstring": "Generate route handler stubs from an OpenAPI specification.\n\nCreates one ``.py`` file per resource in *output_dir*.\nResources are derived from the first path segment (e.g. ``/pets``\nand ``/pets/{id}`` both group under ``pets``).\n\nArgs:\n spec_path:\n Path to the OpenAPI specification file (YAML or JSON).\n output_dir:\n Directory where the generated route files are written.\n Created automatically if it does not exist.\n use_models:\n If ``True``, import Pydantic models from *models_module*\n for request-body schemas referenced via ``$ref``.\n models_module:\n Dotted Python module path from which to import models\n (e.g. ``\"models\"``, ``\"app.models\"``).\n\nReturns:\n list[Path]:\n Absolute paths of every generated route file.\n\nRaises:\n OpenAPISpecLoadError:\n If the spec cannot be loaded or validated.\n ValueError:\n If any operation is missing ``operationId``." + }, + "generate_models": { + "name": "generate_models", + "kind": "function", + "path": "openapi_first.codegen.generate_models", + "signature": "", + "docstring": "Generate Pydantic models from an OpenAPI specification.\n\nArgs:\n spec_path (Path):\n Path to the OpenAPI specification file (YAML or JSON).\n output_path (Path):\n Path where the generated Python code should be written.\n pydantic_version (int, optional):\n The Pydantic version to target (1 or 2). Defaults to 2.\n\nNotes:\n **Reusability:**\n This function is designed to be used by the CLI and can be\n exposed as an MCP tool without modification." + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.codegen_routes.json b/docs/mcp/modules/openapi_first.codegen_routes.json new file mode 100644 index 0000000..539d673 --- /dev/null +++ b/docs/mcp/modules/openapi_first.codegen_routes.json @@ -0,0 +1,37 @@ +{ + "module": "openapi_first.codegen_routes", + "content": { + "path": "openapi_first.codegen_routes", + "docstring": "Route handler code generation from OpenAPI specifications.\n\nThis module generates Python route handler stubs from an OpenAPI 3.x\nspecification. Each resource (derived from the first path segment)\ngets its own file under the output directory. Every OpenAPI operation\nmust define an ``operationId``, which becomes the handler function name.\n\nNotes:\n **Design constraints:**\n\n - ``operationId`` is required on every operation (matching\n ``binder.bind_routes``).\n - Handlers are stubs raising ``NotImplementedError``.\n - Sub-resources (e.g. ``/pets/{id}/photo``) are grouped with their\n parent resource (``pets``).\n - Parameter types and defaults are inferred from the spec.\n - ``response: Response`` is injected for non-200 success codes.", + "objects": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.codegen_routes.Path", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.codegen_routes.Any", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.codegen_routes.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "generate_routes": { + "name": "generate_routes", + "kind": "function", + "path": "openapi_first.codegen_routes.generate_routes", + "signature": "", + "docstring": "Generate route handler stubs from an OpenAPI specification.\n\nCreates one ``.py`` file per resource in *output_dir*.\nResources are derived from the first path segment (e.g. ``/pets``\nand ``/pets/{id}`` both group under ``pets``).\n\nArgs:\n spec_path:\n Path to the OpenAPI specification file (YAML or JSON).\n output_dir:\n Directory where the generated route files are written.\n Created automatically if it does not exist.\n use_models:\n If ``True``, import Pydantic models from *models_module*\n for request-body schemas referenced via ``$ref``.\n models_module:\n Dotted Python module path from which to import models\n (e.g. ``\"models\"``, ``\"app.models\"``).\n\nReturns:\n list[Path]:\n Absolute paths of every generated route file.\n\nRaises:\n OpenAPISpecLoadError:\n If the spec cannot be loaded or validated.\n ValueError:\n If any operation is missing ``operationId``." + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.errors.json b/docs/mcp/modules/openapi_first.errors.json similarity index 87% rename from mcp_docs/modules/openapi_first.errors.json rename to docs/mcp/modules/openapi_first.errors.json index fa0fe98..61b7eca 100644 --- a/mcp_docs/modules/openapi_first.errors.json +++ b/docs/mcp/modules/openapi_first.errors.json @@ -8,22 +8,15 @@ "name": "OpenAPIFirstError", "kind": "class", "path": "openapi_first.errors.OpenAPIFirstError", - "signature": "", + "signature": "", "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." }, "MissingOperationHandler": { "name": "MissingOperationHandler", "kind": "class", "path": "openapi_first.errors.MissingOperationHandler", - "signature": "", + "signature": "", "docstring": "Raised when an OpenAPI operation cannot be resolved to a handler.\n\nNotes:\n **Scenarios:**\n\n - An OpenAPI operation does not define an `operationId`.\n - An `operationId` is defined but no matching function exists in\n the provided routes module.\n\n **Guarantees:**\n\n - This represents a violation of the OpenAPI-first contract and\n indicates that the specification and implementation are out of\n sync." - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "openapi_first.errors.Optional", - "signature": "", - "docstring": null } } } diff --git a/docs/mcp/modules/openapi_first.json b/docs/mcp/modules/openapi_first.json new file mode 100644 index 0000000..5a884cf --- /dev/null +++ b/docs/mcp/modules/openapi_first.json @@ -0,0 +1,2830 @@ +{ + "module": "openapi_first", + "content": { + "path": "openapi_first", + "docstring": "# Summary\n\nFastAPI OpenAPI First — strict OpenAPI-first application bootstrap for FastAPI.\n\nFastAPI OpenAPI First is a **contract-first infrastructure library** that\nenforces OpenAPI as the single source of truth for FastAPI services.\n\nThe library removes decorator-driven routing and replaces it with\ndeterministic, spec-driven application assembly. Every HTTP route,\nmethod, and operation is defined in OpenAPI first and bound to Python\nhandlers explicitly via `operationId`.\n\n---\n\n# Installation\n\nInstall using pip:\n\n```bash\npip install openapi-first\n```\n\nOr with Poetry:\n\n```bash\npoetry add openapi-first\n```\n\n---\n\n# Quick Start\n\nMinimal OpenAPI-first FastAPI application:\n\n```python\nfrom openapi_first import app\nimport my_service.routes as routes\n\napi = app.OpenAPIFirstApp(\n openapi_path=\"openapi.yaml\",\n routes_module=routes,\n title=\"My Service\",\n version=\"1.0.0\",\n)\n```\n\nOperationId-driven HTTP client:\n\n```python\nfrom openapi_first.loader import load_openapi\nfrom openapi_first.client import OpenAPIClient\n\nspec = load_openapi(\"openapi.yaml\")\nclient = OpenAPIClient(spec)\n\nresponse = client.get_health()\n```\n\n---\n\n# Architecture\n\nThe library is structured around four core responsibilities:\n\n- `loader`: Load and validate OpenAPI 3.x specifications (JSON/YAML).\n- `binder`: Bind OpenAPI operations to FastAPI routes via `operationId`.\n- `app`: OpenAPI-first FastAPI application bootstrap.\n- `client`: OpenAPI-first HTTP client driven by the same specification.\n- `errors`: Explicit error hierarchy for contract violations.\n\n---\n\n# Public API\n\nThe supported public API consists of the following top-level modules:\n\n- `openapi_first.app`\n- `openapi_first.binder`\n- `openapi_first.loader`\n- `openapi_first.client`\n- `openapi_first.errors`\n\n---\n\n# Design Guarantees\n\n- OpenAPI is the single source of truth.\n- No undocumented routes can exist.\n- No OpenAPI operation can exist without a handler or client callable.\n- All contract violations fail at application startup or client creation.\n- No hidden FastAPI magic or implicit behavior.\n- Deterministic, testable application assembly.\n\n---", + "objects": { + "app": { + "name": "app", + "kind": "module", + "path": "openapi_first.app", + "signature": null, + "docstring": "# Summary\n\nOpenAPI-first application bootstrap for FastAPI.\n\nThis module provides `OpenAPIFirstApp`, a thin but strict abstraction\nthat enforces OpenAPI as the single source of truth for a FastAPI service.\n\nNotes:\n **Core Principles:**\n\n - The OpenAPI specification (JSON or YAML) defines the entire API surface.\n - Every `operationId` in the OpenAPI spec must have a corresponding\n Python handler function.\n - Handlers are plain Python callables (no FastAPI decorators).\n - FastAPI route registration is derived exclusively from the spec.\n - FastAPI's autogenerated OpenAPI schema is fully overridden.\n\n **Responsibilities:**\n\n - Loads and validates an OpenAPI 3.x specification.\n - Dynamically binds HTTP routes to handler functions using `operationId`.\n - Registers routes with FastAPI at application startup.\n - Ensures runtime behavior matches the OpenAPI contract exactly.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Generate OpenAPI specs.\n - Generate client code.\n - Introduce a new framework or lifecycle.\n - Alter FastAPI dependency injection semantics.", + "members": { + "os": { + "name": "os", + "kind": "alias", + "path": "openapi_first.app.os", + "signature": "", + "docstring": null + }, + "re": { + "name": "re", + "kind": "alias", + "path": "openapi_first.app.re", + "signature": "", + "docstring": null + }, + "FastAPI": { + "name": "FastAPI", + "kind": "alias", + "path": "openapi_first.app.FastAPI", + "signature": "", + "docstring": null + }, + "bind_routes": { + "name": "bind_routes", + "kind": "function", + "path": "openapi_first.app.bind_routes", + "signature": "", + "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n security_deps (dict | None):\n Optional mapping of ``METHOD:/path`` → ``list[Depends(...)]``\n generated from the spec's ``securitySchemes`` and per-operation\n ``security`` fields.\n\nRaises:\n MissingOperationHandler:\n If an ``operationId`` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each ``operationId`` to a handler function, and registers\n a corresponding ``APIRoute`` on the FastAPI application.\n - Injects FastAPI ``Depends()`` for each security requirement found\n on the operation or inherited from the top-level ``security`` field.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "make_security_dependencies": { + "name": "make_security_dependencies", + "kind": "function", + "path": "openapi_first.app.make_security_dependencies", + "signature": "", + "docstring": "Build a mapping of ``METHOD:/path`` → list of ``Depends(...)``.\n\nThe effective security for each operation is resolved by:\n\n1. Using the operation-level ``security`` field if present.\n2. Falling back to the top-level ``security`` field.\n3. An empty list means *no auth required* for that operation." + }, + "parse_security_schemes": { + "name": "parse_security_schemes", + "kind": "function", + "path": "openapi_first.app.parse_security_schemes", + "signature": "", + "docstring": "Extract and resolve environment variables in security schemes." + }, + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.app.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.app.OpenAPIFirstApp.openapi", + "signature": null, + "docstring": null + } + } + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.app.Any", + "signature": "", + "docstring": null + } + } + }, + "binder": { + "name": "binder", + "kind": "module", + "path": "openapi_first.binder", + "signature": null, + "docstring": "# Summary\n\nOpenAPI-driven route binding for FastAPI.\n\nThis module is responsible for translating an OpenAPI 3.x specification\ninto concrete FastAPI routes. It enforces a strict one-to-one mapping\nbetween OpenAPI operations and Python handler functions using `operationId`.\n\nNotes:\n **Core Responsibility:**\n\n - Read path + method definitions from an OpenAPI specification.\n - Resolve each `operationId` to a Python callable.\n - Register routes with FastAPI using `APIRoute`.\n - Fail fast when contract violations are detected.\n\n **Design Constraints:**\n\n - All routes MUST be declared in the OpenAPI specification.\n - All OpenAPI operations MUST define an `operationId`.\n - Every `operationId` MUST resolve to a handler function.\n - Handlers are plain Python callables (no decorators required).\n - No implicit route creation or inference is allowed.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Perform request or response validation.\n - Generate Pydantic models.\n - Modify FastAPI dependency injection.\n - Interpret OpenAPI semantics beyond routing metadata.", + "members": { + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.binder.Any", + "signature": "", + "docstring": null + }, + "APIRoute": { + "name": "APIRoute", + "kind": "alias", + "path": "openapi_first.binder.APIRoute", + "signature": "", + "docstring": null + }, + "MissingOperationHandler": { + "name": "MissingOperationHandler", + "kind": "class", + "path": "openapi_first.binder.MissingOperationHandler", + "signature": "", + "docstring": "Raised when an OpenAPI operation cannot be resolved to a handler.\n\nNotes:\n **Scenarios:**\n\n - An OpenAPI operation does not define an `operationId`.\n - An `operationId` is defined but no matching function exists in\n the provided routes module.\n\n **Guarantees:**\n\n - This represents a violation of the OpenAPI-first contract and\n indicates that the specification and implementation are out of\n sync." + }, + "bind_routes": { + "name": "bind_routes", + "kind": "function", + "path": "openapi_first.binder.bind_routes", + "signature": "", + "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n security_deps (dict | None):\n Optional mapping of ``METHOD:/path`` → ``list[Depends(...)]``\n generated from the spec's ``securitySchemes`` and per-operation\n ``security`` fields.\n\nRaises:\n MissingOperationHandler:\n If an ``operationId`` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each ``operationId`` to a handler function, and registers\n a corresponding ``APIRoute`` on the FastAPI application.\n - Injects FastAPI ``Depends()`` for each security requirement found\n on the operation or inherited from the top-level ``security`` field.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." + }, + "FastAPI": { + "name": "FastAPI", + "kind": "alias", + "path": "openapi_first.binder.FastAPI", + "signature": "", + "docstring": null + } + } + }, + "cli": { + "name": "cli", + "kind": "module", + "path": "openapi_first.cli", + "signature": null, + "docstring": "Command-line interface for FastAPI OpenAPI-first scaffolding utilities.\n\n---\n\n## Summary\n\nThis CLI bootstraps OpenAPI-first FastAPI applications from versioned,\nbundled templates packaged with the library.", + "members": { + "argparse": { + "name": "argparse", + "kind": "alias", + "path": "openapi_first.cli.argparse", + "signature": "", + "docstring": null + }, + "shutil": { + "name": "shutil", + "kind": "alias", + "path": "openapi_first.cli.shutil", + "signature": "", + "docstring": null + }, + "resources": { + "name": "resources", + "kind": "alias", + "path": "openapi_first.cli.resources", + "signature": "", + "docstring": null + }, + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.cli.Path", + "signature": "", + "docstring": null + }, + "DEFAULT_TEMPLATE": { + "name": "DEFAULT_TEMPLATE", + "kind": "attribute", + "path": "openapi_first.cli.DEFAULT_TEMPLATE", + "signature": null, + "docstring": null + }, + "available_templates": { + "name": "available_templates", + "kind": "function", + "path": "openapi_first.cli.available_templates", + "signature": "", + "docstring": "Return a list of available application templates.\n\nReturns:\n list[str]:\n Sorted list of template names found in the internal templates directory." + }, + "copy_template": { + "name": "copy_template", + "kind": "function", + "path": "openapi_first.cli.copy_template", + "signature": "", + "docstring": "Copy a bundled OpenAPI-first application template into a directory.\n\nArgs:\n template (str):\n Name of the template to copy.\n target_dir (Path):\n Filesystem path where the template should be copied.\n\nRaises:\n FileNotFoundError:\n If the requested template does not exist." + }, + "main": { + "name": "main", + "kind": "function", + "path": "openapi_first.cli.main", + "signature": "", + "docstring": null + } + } + }, + "client": { + "name": "client", + "kind": "module", + "path": "openapi_first.client", + "signature": null, + "docstring": "# Summary\n\nOpenAPI-first HTTP client for contract-driven services.\n\nThis module provides `OpenAPIClient`, a thin, strict HTTP client that\nderives all callable operations directly from an OpenAPI 3.x specification.\n\nIt is the client counterpart to `OpenAPIFirstApp`.\n\nNotes:\n **Core Principles:**\n\n - The OpenAPI specification is the single source of truth\n - Each operationId becomes a callable Python method\n - No implicit schema mutation or inference\n - No code generation step\n - Minimal abstraction over httpx\n\n **Responsibilities:**\n\n - Parses an OpenAPI 3.x specification\n - Dynamically creates one callable per operationId\n - Enforces presence of servers, paths, and operationId\n - Formats path parameters safely\n - Handles JSON request bodies explicitly\n - Returns raw `httpx.Response` objects\n\n **Constraints:**\n\n - This module intentionally does NOT: Generate client code, validate request/response schemas, deserialize responses, retry requests, implement authentication helpers, or assume non-2xx responses are failures.", + "members": { + "Callable": { + "name": "Callable", + "kind": "alias", + "path": "openapi_first.client.Callable", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.client.Any", + "signature": "", + "docstring": null + }, + "urljoin": { + "name": "urljoin", + "kind": "alias", + "path": "openapi_first.client.urljoin", + "signature": "", + "docstring": null + }, + "httpx": { + "name": "httpx", + "kind": "alias", + "path": "openapi_first.client.httpx", + "signature": "", + "docstring": null + }, + "OpenAPIFirstError": { + "name": "OpenAPIFirstError", + "kind": "class", + "path": "openapi_first.client.OpenAPIFirstError", + "signature": "", + "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." + }, + "OpenAPIClientError": { + "name": "OpenAPIClientError", + "kind": "class", + "path": "openapi_first.client.OpenAPIClientError", + "signature": "", + "docstring": "Raised when an OpenAPI client operation fails." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.client.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.client.OpenAPIClient.spec", + "signature": null, + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.client.OpenAPIClient.base_url", + "signature": null, + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.client.OpenAPIClient.client", + "signature": null, + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.client.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + } + } + }, + "codegen": { + "name": "codegen", + "kind": "module", + "path": "openapi_first.codegen", + "signature": null, + "docstring": "# Summary\n\nCore logic for generating Python source code from OpenAPI specifications.\n\nThis module provides reusable utilities for code generation, specifically\ngenerating Pydantic models and route handler stubs from OpenAPI 3.x schema\ndefinitions.", + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.codegen.Path", + "signature": "", + "docstring": null + }, + "InputFileType": { + "name": "InputFileType", + "kind": "alias", + "path": "openapi_first.codegen.InputFileType", + "signature": "", + "docstring": null + }, + "PythonVersion": { + "name": "PythonVersion", + "kind": "alias", + "path": "openapi_first.codegen.PythonVersion", + "signature": "", + "docstring": null + }, + "generate": { + "name": "generate", + "kind": "alias", + "path": "openapi_first.codegen.generate", + "signature": "", + "docstring": null + }, + "generate_routes": { + "name": "generate_routes", + "kind": "function", + "path": "openapi_first.codegen.generate_routes", + "signature": "", + "docstring": "Generate route handler stubs from an OpenAPI specification.\n\nCreates one ``.py`` file per resource in *output_dir*.\nResources are derived from the first path segment (e.g. ``/pets``\nand ``/pets/{id}`` both group under ``pets``).\n\nArgs:\n spec_path:\n Path to the OpenAPI specification file (YAML or JSON).\n output_dir:\n Directory where the generated route files are written.\n Created automatically if it does not exist.\n use_models:\n If ``True``, import Pydantic models from *models_module*\n for request-body schemas referenced via ``$ref``.\n models_module:\n Dotted Python module path from which to import models\n (e.g. ``\"models\"``, ``\"app.models\"``).\n\nReturns:\n list[Path]:\n Absolute paths of every generated route file.\n\nRaises:\n OpenAPISpecLoadError:\n If the spec cannot be loaded or validated.\n ValueError:\n If any operation is missing ``operationId``." + }, + "generate_models": { + "name": "generate_models", + "kind": "function", + "path": "openapi_first.codegen.generate_models", + "signature": "", + "docstring": "Generate Pydantic models from an OpenAPI specification.\n\nArgs:\n spec_path (Path):\n Path to the OpenAPI specification file (YAML or JSON).\n output_path (Path):\n Path where the generated Python code should be written.\n pydantic_version (int, optional):\n The Pydantic version to target (1 or 2). Defaults to 2.\n\nNotes:\n **Reusability:**\n This function is designed to be used by the CLI and can be\n exposed as an MCP tool without modification." + } + } + }, + "codegen_routes": { + "name": "codegen_routes", + "kind": "module", + "path": "openapi_first.codegen_routes", + "signature": null, + "docstring": "Route handler code generation from OpenAPI specifications.\n\nThis module generates Python route handler stubs from an OpenAPI 3.x\nspecification. Each resource (derived from the first path segment)\ngets its own file under the output directory. Every OpenAPI operation\nmust define an ``operationId``, which becomes the handler function name.\n\nNotes:\n **Design constraints:**\n\n - ``operationId`` is required on every operation (matching\n ``binder.bind_routes``).\n - Handlers are stubs raising ``NotImplementedError``.\n - Sub-resources (e.g. ``/pets/{id}/photo``) are grouped with their\n parent resource (``pets``).\n - Parameter types and defaults are inferred from the spec.\n - ``response: Response`` is injected for non-200 success codes.", + "members": { + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.codegen_routes.Path", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.codegen_routes.Any", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.codegen_routes.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "generate_routes": { + "name": "generate_routes", + "kind": "function", + "path": "openapi_first.codegen_routes.generate_routes", + "signature": "", + "docstring": "Generate route handler stubs from an OpenAPI specification.\n\nCreates one ``.py`` file per resource in *output_dir*.\nResources are derived from the first path segment (e.g. ``/pets``\nand ``/pets/{id}`` both group under ``pets``).\n\nArgs:\n spec_path:\n Path to the OpenAPI specification file (YAML or JSON).\n output_dir:\n Directory where the generated route files are written.\n Created automatically if it does not exist.\n use_models:\n If ``True``, import Pydantic models from *models_module*\n for request-body schemas referenced via ``$ref``.\n models_module:\n Dotted Python module path from which to import models\n (e.g. ``\"models\"``, ``\"app.models\"``).\n\nReturns:\n list[Path]:\n Absolute paths of every generated route file.\n\nRaises:\n OpenAPISpecLoadError:\n If the spec cannot be loaded or validated.\n ValueError:\n If any operation is missing ``operationId``." + } + } + }, + "errors": { + "name": "errors", + "kind": "module", + "path": "openapi_first.errors", + "signature": null, + "docstring": "# Summary\n\nExceptions for OpenAPI-first FastAPI applications.\n\nThis module defines a small hierarchy of explicit, intention-revealing\nexceptions used to signal contract violations between an OpenAPI\nspecification and its Python implementation.\n\nNotes:\n **Design Principles:**\n\n - Errors represent programmer mistakes, not runtime conditions.\n - All errors are raised during application startup.\n - Messages are actionable and suitable for CI/CD output.\n - Exceptions are explicit rather than reused from generic built-ins.\n\n These errors should normally cause immediate application failure.", + "members": { + "OpenAPIFirstError": { + "name": "OpenAPIFirstError", + "kind": "class", + "path": "openapi_first.errors.OpenAPIFirstError", + "signature": "", + "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." + }, + "MissingOperationHandler": { + "name": "MissingOperationHandler", + "kind": "class", + "path": "openapi_first.errors.MissingOperationHandler", + "signature": "", + "docstring": "Raised when an OpenAPI operation cannot be resolved to a handler.\n\nNotes:\n **Scenarios:**\n\n - An OpenAPI operation does not define an `operationId`.\n - An `operationId` is defined but no matching function exists in\n the provided routes module.\n\n **Guarantees:**\n\n - This represents a violation of the OpenAPI-first contract and\n indicates that the specification and implementation are out of\n sync." + } + } + }, + "loader": { + "name": "loader", + "kind": "module", + "path": "openapi_first.loader", + "signature": null, + "docstring": "# Summary\n\nOpenAPI specification loading and validation utilities.\n\nThis module is responsible for loading an OpenAPI 3.x specification\nfrom disk and validating it before it is used by the application.\n\nIt enforces the principle that an invalid or malformed OpenAPI document\nmust never reach the routing or runtime layers.\n\nNotes:\n **Design Principles:**\n\n - OpenAPI is treated as an authoritative contract.\n - Invalid specifications fail fast at application startup.\n - Supported formats are JSON and YAML.\n - Validation errors are surfaced clearly and early.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Modify the OpenAPI document.\n - Infer missing fields.\n - Generate models or code.\n - Perform request/response validation at runtime.", + "members": { + "json": { + "name": "json", + "kind": "alias", + "path": "openapi_first.loader.json", + "signature": "", + "docstring": null + }, + "Path": { + "name": "Path", + "kind": "alias", + "path": "openapi_first.loader.Path", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.loader.Any", + "signature": "", + "docstring": null + }, + "yaml": { + "name": "yaml", + "kind": "alias", + "path": "openapi_first.loader.yaml", + "signature": "", + "docstring": null + }, + "validate_spec": { + "name": "validate_spec", + "kind": "alias", + "path": "openapi_first.loader.validate_spec", + "signature": "", + "docstring": null + }, + "OpenAPIFirstError": { + "name": "OpenAPIFirstError", + "kind": "class", + "path": "openapi_first.loader.OpenAPIFirstError", + "signature": "", + "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." + }, + "OpenAPISpecLoadError": { + "name": "OpenAPISpecLoadError", + "kind": "class", + "path": "openapi_first.loader.OpenAPISpecLoadError", + "signature": "", + "docstring": "Raised when an OpenAPI specification cannot be loaded or validated.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the OpenAPI document is unreadable,\n malformed, or violates the OpenAPI 3.x specification." + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.loader.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + } + } + }, + "security": { + "name": "security", + "kind": "module", + "path": "openapi_first.security", + "signature": null, + "docstring": "OpenAPI security scheme parsing and auto-generated auth dependencies.\n\nReads `securitySchemes` and per-operation `security` from an OpenAPI spec,\nresolves `{ENV_VAR}` placeholders in `x-` extension fields, and generates\nFastAPI dependencies for token validation (e.g., Bearer JWT introspection).", + "members": { + "os": { + "name": "os", + "kind": "alias", + "path": "openapi_first.security.os", + "signature": "", + "docstring": null + }, + "re": { + "name": "re", + "kind": "alias", + "path": "openapi_first.security.re", + "signature": "", + "docstring": null + }, + "Callable": { + "name": "Callable", + "kind": "alias", + "path": "openapi_first.security.Callable", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.security.Any", + "signature": "", + "docstring": null + }, + "httpx": { + "name": "httpx", + "kind": "alias", + "path": "openapi_first.security.httpx", + "signature": "", + "docstring": null + }, + "Depends": { + "name": "Depends", + "kind": "alias", + "path": "openapi_first.security.Depends", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.security.HTTPException", + "signature": "", + "docstring": null + }, + "Request": { + "name": "Request", + "kind": "alias", + "path": "openapi_first.security.Request", + "signature": "", + "docstring": null + }, + "HTTPAuthorizationCredentials": { + "name": "HTTPAuthorizationCredentials", + "kind": "alias", + "path": "openapi_first.security.HTTPAuthorizationCredentials", + "signature": "", + "docstring": null + }, + "HTTPBearer": { + "name": "HTTPBearer", + "kind": "alias", + "path": "openapi_first.security.HTTPBearer", + "signature": "", + "docstring": null + }, + "parse_security_schemes": { + "name": "parse_security_schemes", + "kind": "function", + "path": "openapi_first.security.parse_security_schemes", + "signature": "", + "docstring": "Extract and resolve environment variables in security schemes." + }, + "make_security_dependencies": { + "name": "make_security_dependencies", + "kind": "function", + "path": "openapi_first.security.make_security_dependencies", + "signature": "", + "docstring": "Build a mapping of ``METHOD:/path`` → list of ``Depends(...)``.\n\nThe effective security for each operation is resolved by:\n\n1. Using the operation-level ``security`` field if present.\n2. Falling back to the top-level ``security`` field.\n3. An empty list means *no auth required* for that operation." + } + } + }, + "templates": { + "name": "templates", + "kind": "module", + "path": "openapi_first.templates", + "signature": null, + "docstring": "Application templates for FastAPI OpenAPI First.\n\nThis package contains example and scaffolding templates intended to be\ncopied into user projects via the ``openapi-first`` CLI.\n\nTemplates in this package are:\n- Reference implementations of OpenAPI-first services\n- Not part of the ``openapi_first`` public or internal API\n- Not intended to be imported as runtime dependencies\n\nThe presence of this file exists solely to:\n- Mark the directory as an explicit Python package\n- Enable deterministic tooling behavior (documentation, packaging)\n- Avoid accidental traversal of non-package directories\n\nNo code in this package should be imported by library consumers.", + "members": { + "crud_app": { + "name": "crud_app", + "kind": "module", + "path": "openapi_first.templates.crud_app", + "signature": null, + "docstring": "OpenAPI-first CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new CRUD example service using the bundled template:\n\n openapi-first crud_app\n\nCreate the service in a custom directory:\n\n openapi-first crud_app my-crud-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "members": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.crud_app.data", + "signature": null, + "docstring": "In-memory mock data store for CRUD example.\n\nThis module intentionally avoids persistence and concurrency guarantees.\nIt is suitable for demos, tests, and scaffolding only.\n\nIt intentionally avoids\n- persistence\n- concurrency guarantees\n- validation\n- error handling\n\nThe implementation is suitable for:\n- demonstrations\n- tests\n- scaffolding and example services\n\nIt is explicitly NOT suitable for production use.\n\nThis module is not part of the ``openapi_first`` library API surface.", + "members": { + "Dict": { + "name": "Dict", + "kind": "alias", + "path": "openapi_first.templates.crud_app.data.Dict", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.list_items", + "signature": "", + "docstring": "Return all items in the data store.\n\nThis function performs no filtering, pagination, or sorting.\nThe returned collection reflects the current in-memory state.\n\nReturns\n-------\nlist[dict]\n A list of item representations." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present in the store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The stored item representation." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.create_item", + "signature": "", + "docstring": "Create a new item in the data store.\n\nA new integer ID is assigned automatically. No validation is\nperformed on the provided payload.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The newly created item, including its assigned ID." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.update_item", + "signature": "", + "docstring": "Replace an existing item in the data store.\n\nThis function overwrites the existing item entirely and does not\nperform partial updates or validation. If the item does not exist,\nit will be created implicitly.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item representation." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.delete_item", + "signature": "", + "docstring": "Remove an item from the data store.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete." + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.crud_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.crud_app.main.routes", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.crud_app.routes", + "signature": null, + "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThese handlers explicitly control HTTP status codes to ensure\nruntime behavior matches the OpenAPI contract.\n\nThis module defines OpenAPI-bound operation handlers for a simple CRUD\nservice. Functions in this module are bound to HTTP routes exclusively\nvia OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Error conditions are translated\ninto explicit HTTP responses rather than relying on implicit framework\nbehavior.\n\nNo routing decorators or path definitions appear in this module. All\nrouting, HTTP methods, and schemas are defined in the OpenAPI\nspecification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.crud_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.crud_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.list_items", + "signature": "", + "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[dict]\n A list of item representations." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.create_item", + "signature": "", + "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\ndict\n The newly created item." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.update_item", + "signature": "", + "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.delete_item", + "signature": "", + "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + } + } + }, + "test_crud_app": { + "name": "test_crud_app", + "kind": "module", + "path": "openapi_first.templates.crud_app.test_crud_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Correct HTTP status codes and response payloads\n\nThe tests exercise all CRUD operations against an in-memory mock data\nstore and assume deterministic behavior within a single process.\n\nThe tests assume:\n- OpenAPI-first route binding\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process\n- One-to-one correspondence between OpenAPI operationId values and\n server/client callables", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.crud_app.test_crud_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.crud_app.test_crud_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.spec", + "signature": null, + "docstring": null + }, + "test_list_items_initial": { + "name": "test_list_items_initial", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_list_items_initial", + "signature": "", + "docstring": "Initial items should be present." + }, + "test_get_item": { + "name": "test_get_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_get_item", + "signature": "", + "docstring": "Existing item should be retrievable by ID." + }, + "test_create_item": { + "name": "test_create_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_create_item", + "signature": "", + "docstring": "Creating a new item should return the created entity." + }, + "test_update_item": { + "name": "test_update_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_update_item", + "signature": "", + "docstring": "Updating an item should replace its values." + }, + "test_delete_item": { + "name": "test_delete_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_delete_item", + "signature": "", + "docstring": "Deleting an item should remove it from the store." + } + } + } + } + }, + "health_app": { + "name": "health_app", + "kind": "module", + "path": "openapi_first.templates.health_app", + "signature": null, + "docstring": "OpenAPI-first FastAPI application template.\n\nThis package contains a minimal, fully working example of an\nOpenAPI-first FastAPI service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace (``routes``)\n\nNo routing decorators, implicit behavior, or framework-specific\nconvenience abstractions are used. All HTTP routes, methods, and\noperation bindings are defined in OpenAPI and enforced at application\nstartup.\n\nThis package is intended to be copied as a starting point for new\nservices via the ``openapi-first`` CLI. It is not part of the\n``openapi_first`` library API surface.\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new OpenAPI-first health check service using the bundled\ntemplate:\n\n openapi-first health_app\n\nCreate the service in a custom directory:\n\n openapi-first health_app my-health-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client call for the ``get_health`` operation:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n response = client.get_health()\n\n assert response.status_code == 200\n assert response.json() == {\"status\": \"ok\"}\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time", + "members": { + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.health_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first FastAPI service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, and operation bindings are defined in the\nOpenAPI document referenced by ``openapi_path``. Python callables\ndefined in the ``routes`` module are bound to OpenAPI operations\nstrictly via ``operationId``.\n\nThis module contains no routing logic, request handling, or framework\nconfiguration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.health_app.main.routes", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.health_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.health_app.routes", + "signature": null, + "docstring": "OpenAPI operation handlers.\n\nThis module defines pure Python callables that implement OpenAPI\noperations for this service. Functions in this module are bound to HTTP\nroutes exclusively via OpenAPI ``operationId`` values.\n\nNo routing decorators, HTTP metadata, or framework-specific logic\nshould appear here. All request/response semantics are defined in the\nOpenAPI specification.\n\nThis module serves solely as an operationId namespace.", + "members": { + "get_health": { + "name": "get_health", + "kind": "function", + "path": "openapi_first.templates.health_app.routes.get_health", + "signature": "", + "docstring": "Health check operation handler.\n\nThis function implements the OpenAPI operation identified by\n``operationId: get_health``.\n\nIt contains no routing metadata or framework-specific logic.\nRequest binding, HTTP method, and response semantics are defined\nexclusively by the OpenAPI specification.\n\nReturns\n-------\ndict\n A minimal liveness payload indicating service health." + } + } + } + } + }, + "model_app": { + "name": "model_app", + "kind": "module", + "path": "openapi_first.templates.model_app", + "signature": null, + "docstring": "OpenAPI-first model-based CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service that uses explicit Pydantic domain models for request and\nresponse schemas.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- Pydantic domain models (``models``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit request and response modeling with Pydantic\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new model-based CRUD example service using the bundled template:\n\n openapi-first model_app\n\nCreate the service in a custom directory:\n\n openapi-first model_app my-model-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for model-based CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Request and response payloads conform to Pydantic models\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "members": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.model_app.data", + "signature": null, + "docstring": "In-memory data store using Pydantic models.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\nThis module provides a minimal, process-local data store for the\nmodel-based CRUD example application. It stores and returns domain\nobjects defined using Pydantic models and is intended solely for\ndemonstration and scaffolding purposes.\n\nThe implementation intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nIt is not part of the ``openapi_first`` library API surface.", + "members": { + "Dict": { + "name": "Dict", + "kind": "alias", + "path": "openapi_first.templates.model_app.data.Dict", + "signature": "", + "docstring": null + }, + "Item": { + "name": "Item", + "kind": "alias", + "path": "openapi_first.templates.model_app.data.Item", + "signature": "", + "docstring": null + }, + "ItemCreate": { + "name": "ItemCreate", + "kind": "alias", + "path": "openapi_first.templates.model_app.data.ItemCreate", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.model_app.data.list_items", + "signature": "", + "docstring": "Return all items in the data store.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nKeyError\n If the item does not exist." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.create_item", + "signature": "", + "docstring": "Create a new item in the data store.\n\nA new identifier is assigned automatically. No additional validation\nis performed beyond Pydantic model validation.\n\nParameters\n----------\npayload : ItemCreate\n Data required to create a new item.\n\nReturns\n-------\nItem\n The newly created item." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.update_item", + "signature": "", + "docstring": "Replace an existing item in the data store.\n\nThis function performs a full replacement of the stored item.\nPartial updates are not supported.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nKeyError\n If the item does not exist." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.delete_item", + "signature": "", + "docstring": "Remove an item from the data store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\n\nRaises\n------\nKeyError\n If the item does not exist." + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.model_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first model-based CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.model_app.main.routes", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.model_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "models": { + "name": "models", + "kind": "module", + "path": "openapi_first.templates.model_app.models", + "signature": null, + "docstring": "Pydantic domain models for the CRUD example.\n\nThis module defines Pydantic models that represent the domain entities\nused by the service. These models are referenced by the OpenAPI\nspecification for request and response schemas.\n\nThe models are declarative and framework-agnostic. They contain no\npersistence logic, validation beyond type constraints, or business\nbehavior.\n\nThis module is not part of the ``openapi_first`` library API surface.\nIt exists solely to support the example application template.", + "members": { + "BaseModel": { + "name": "BaseModel", + "kind": "alias", + "path": "openapi_first.templates.model_app.models.BaseModel", + "signature": "", + "docstring": null + }, + "ItemBase": { + "name": "ItemBase", + "kind": "class", + "path": "openapi_first.templates.model_app.models.ItemBase", + "signature": "", + "docstring": "Base domain model for an item.\n\nDefines fields common to all item representations.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.model_app.models.ItemBase.name", + "signature": null, + "docstring": null + }, + "price": { + "name": "price", + "kind": "attribute", + "path": "openapi_first.templates.model_app.models.ItemBase.price", + "signature": null, + "docstring": null + } + } + }, + "ItemCreate": { + "name": "ItemCreate", + "kind": "class", + "path": "openapi_first.templates.model_app.models.ItemCreate", + "signature": "", + "docstring": "Domain model for item creation requests.\n\nThis model is used for request bodies when creating new items.\nIt intentionally excludes the ``id`` field, which is assigned\nby the service." + }, + "Item": { + "name": "Item", + "kind": "class", + "path": "openapi_first.templates.model_app.models.Item", + "signature": "", + "docstring": "Domain model for a persisted item.\n\nThis model represents the full item state returned in responses,\nincluding the server-assigned identifier.", + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.model_app.models.Item.id", + "signature": null, + "docstring": null + } + } + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.model_app.routes", + "signature": null, + "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThis module defines OpenAPI-bound operation handlers for a model-based\nCRUD service. Functions in this module are bound to HTTP routes\nexclusively via OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.model_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.model_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "ItemCreate": { + "name": "ItemCreate", + "kind": "alias", + "path": "openapi_first.templates.model_app.routes.ItemCreate", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.list_items", + "signature": "", + "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.create_item", + "signature": "", + "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : ItemCreate\n Request body describing the item to create.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nItem\n The newly created item." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.update_item", + "signature": "", + "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.delete_item", + "signature": "", + "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + } + } + }, + "test_model_app": { + "name": "test_model_app", + "kind": "module", + "path": "openapi_first.templates.model_app.test_model_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first model CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Pydantic model-based request and response handling\n\nAll CRUD operations are exercised against an in-memory mock data store\nbacked by Pydantic domain models.\n\nThe tests assume:\n- OpenAPI-first route binding\n- Pydantic model validation\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.model_app.test_model_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.model_app.test_model_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.spec", + "signature": null, + "docstring": null + }, + "test_list_items_initial": { + "name": "test_list_items_initial", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_list_items_initial", + "signature": "", + "docstring": "Initial items should be present." + }, + "test_get_item": { + "name": "test_get_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_get_item", + "signature": "", + "docstring": "Existing item should be retrievable by ID." + }, + "test_create_item": { + "name": "test_create_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_create_item", + "signature": "", + "docstring": "Creating a new item should return the created entity." + }, + "test_update_item": { + "name": "test_update_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_update_item", + "signature": "", + "docstring": "Updating an item should replace its values." + }, + "test_delete_item": { + "name": "test_delete_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_delete_item", + "signature": "", + "docstring": "Deleting an item should remove it from the store." + } + } + } + } + }, + "vet_app": { + "name": "vet_app", + "kind": "module", + "path": "openapi_first.templates.vet_app", + "signature": null, + "docstring": "OpenAPI-first Veterinary Clinic application template.\n\nThis package contains a complete, runnable example of an OpenAPI-first\nveterinary clinic management service. It demonstrates all ``x-`` extension\nfields consumed by the ``react-openapi`` admin panel renderer.\n\nThe application manages five resources:\n\n- **Parents** — pet owners with contact details\n- **Vets** — veterinarians with specializations\n- **Treatments** — medical procedure catalog\n- **Pets** — animals with species, age, weight, and photos\n- **Appointments** — scheduled visits linking pets, vets, and treatments\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification (``openapi.yaml``). Every operation has an\nexplicit ``operationId`` that maps to a Python handler in ``routes.py``.\n\nThis file is a copyable template. It is not part of the ``openapi_first``\nlibrary API surface.\n\n----------------------------------------------------------------------\nOpenAPI x- extension fields demonstrated\n----------------------------------------------------------------------\n\nSchema-level extensions (display metadata for resource endpoints):\n\n ``x-primary-key`` (REQUIRED) Primary key property name\n ``x-display-format`` (REQUIRED) Human-readable label template\n ``x-list-columns`` (REQUIRED) Columns for the datatable\n\nProperty-level extensions (control UI rendering):\n\n ``x-label`` (REQUIRED) Human-readable field label\n ``x-order`` (REQUIRED) Field ordering in forms/detail\n ``x-description`` (optional) Helper text below form fields\n ``x-hidden`` (optional) Visibility in form / list / detail\n ``x-filterable`` (optional) Allows column filtering\n ``x-sortable`` (optional) Allows column sorting\n ``x-fk`` (optional) Foreign key — renders as dropdown\n ``x-fk.resource`` (REQUIRED for FK) Target resource name\n ``x-fk.prefetch`` (optional) Preload all FK options on mount\n ``x-ui-type`` (optional) Custom UI type (e.g. image upload)\n ``x-upload-url`` (optional) Upload endpoint for binary fields\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new vet clinic service using the bundled template:\n\n openapi-first vet_app\n\nCreate the service in a custom directory:\n\n openapi-first vet_app my-vet-clinic\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List pets with pagination\n response = client.list_pets(query_params={\"limit\": 10, \"offset\": 0})\n\n # Create a pet with FK references\n response = client.create_pet(\n body={\"name\": \"Fido\", \"species\": \"dog\", \"parents\": [1, 2]}\n )\n\n # Upload a pet photo\n response = client.upload_pet_photo(\n path_params={\"id\": 1},\n body={\"file\": open(\"photo.jpg\", \"rb\")},\n )\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "members": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.vet_app.data", + "signature": null, + "docstring": "In-memory data store for the Veterinary Clinic example.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\n\nIt provides minimal, process-local data stores for the five veterinary\nclinic entities. Each store exposes standard CRUD operations backed by\na simple dictionary.\n\nThis module intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nThis module is not part of the ``openapi_first`` library API surface.", + "members": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.datetime", + "signature": "", + "docstring": null + }, + "timezone": { + "name": "timezone", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.timezone", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Parent", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.ParentCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Vet", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VetCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Treatment", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Procedure", + "signature": "", + "docstring": null + }, + "BasicNote": { + "name": "BasicNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.BasicNote", + "signature": "", + "docstring": null + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.HeartRateNote", + "signature": "", + "docstring": null + }, + "DentalNote": { + "name": "DentalNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.DentalNote", + "signature": "", + "docstring": null + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VaccineNote", + "signature": "", + "docstring": null + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PreOpNote", + "signature": "", + "docstring": null + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.SurgeryNote", + "signature": "", + "docstring": null + }, + "Pet": { + "name": "Pet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Pet", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PetCreate", + "signature": "", + "docstring": null + }, + "Appointment": { + "name": "Appointment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Appointment", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_parents", + "signature": "", + "docstring": null + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_parent", + "signature": "", + "docstring": null + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_parent", + "signature": "", + "docstring": null + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_parent", + "signature": "", + "docstring": null + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_parent", + "signature": "", + "docstring": null + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_vets", + "signature": "", + "docstring": null + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_vet", + "signature": "", + "docstring": null + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_vet", + "signature": "", + "docstring": null + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_vet", + "signature": "", + "docstring": null + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_vet", + "signature": "", + "docstring": null + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_treatments", + "signature": "", + "docstring": null + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_treatment", + "signature": "", + "docstring": null + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_treatment", + "signature": "", + "docstring": null + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_treatment", + "signature": "", + "docstring": null + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_treatment", + "signature": "", + "docstring": null + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_pets", + "signature": "", + "docstring": null + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_pet", + "signature": "", + "docstring": null + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_pet", + "signature": "", + "docstring": null + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_pet", + "signature": "", + "docstring": null + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_pet", + "signature": "", + "docstring": null + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_appointments", + "signature": "", + "docstring": null + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_appointment", + "signature": "", + "docstring": null + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_appointment", + "signature": "", + "docstring": null + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_appointment", + "signature": "", + "docstring": null + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_appointment", + "signature": "", + "docstring": null + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.vet_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first Veterinary Clinic service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "asynccontextmanager": { + "name": "asynccontextmanager", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.asynccontextmanager", + "signature": "", + "docstring": null + }, + "CORSMiddleware": { + "name": "CORSMiddleware", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.CORSMiddleware", + "signature": "", + "docstring": null + }, + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.routes", + "signature": "", + "docstring": null + }, + "lifespan": { + "name": "lifespan", + "kind": "function", + "path": "openapi_first.templates.vet_app.main.lifespan", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "models": { + "name": "models", + "kind": "module", + "path": "openapi_first.templates.vet_app.models", + "signature": null, + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.datetime", + "signature": "", + "docstring": null + }, + "Annotated": { + "name": "Annotated", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Annotated", + "signature": "", + "docstring": null + }, + "Literal": { + "name": "Literal", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Literal", + "signature": "", + "docstring": null + }, + "BaseModel": { + "name": "BaseModel", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.BaseModel", + "signature": "", + "docstring": null + }, + "Field": { + "name": "Field", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Field", + "signature": "", + "docstring": null + }, + "Metadata": { + "name": "Metadata", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Metadata", + "signature": "", + "docstring": null, + "members": { + "createdOn": { + "name": "createdOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.createdOn", + "signature": null, + "docstring": null + }, + "updatedOn": { + "name": "updatedOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.updatedOn", + "signature": null, + "docstring": null + } + } + }, + "ParentBase": { + "name": "ParentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.name", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentCreate", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Parent", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Parent.id", + "signature": null, + "docstring": null + } + } + }, + "VetBase": { + "name": "VetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.name", + "signature": null, + "docstring": null + }, + "specialty": { + "name": "specialty", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.specialty", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "VetCreate": { + "name": "VetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Vet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Vet.id", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNoteBase": { + "name": "ProcedureNoteBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase", + "signature": "", + "docstring": null, + "members": { + "summary": { + "name": "summary", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.summary", + "signature": null, + "docstring": null + }, + "details": { + "name": "details", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.details", + "signature": null, + "docstring": null + } + } + }, + "BasicNote": { + "name": "BasicNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.BasicNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.BasicNote.noteType", + "signature": null, + "docstring": null + } + } + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.HeartRateNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.noteType", + "signature": null, + "docstring": null + }, + "bpm": { + "name": "bpm", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.bpm", + "signature": null, + "docstring": null + } + } + }, + "DentalNote": { + "name": "DentalNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.DentalNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.noteType", + "signature": null, + "docstring": null + }, + "procedureType": { + "name": "procedureType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.procedureType", + "signature": null, + "docstring": null + }, + "teeth": { + "name": "teeth", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.teeth", + "signature": null, + "docstring": null + } + } + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VaccineNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.noteType", + "signature": null, + "docstring": null + }, + "medicine": { + "name": "medicine", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.medicine", + "signature": null, + "docstring": null + }, + "leg": { + "name": "leg", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.leg", + "signature": null, + "docstring": null + } + } + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PreOpNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.noteType", + "signature": null, + "docstring": null + }, + "heartRate": { + "name": "heartRate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.heartRate", + "signature": null, + "docstring": null + }, + "temperature": { + "name": "temperature", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.temperature", + "signature": null, + "docstring": null + } + } + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.SurgeryNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.noteType", + "signature": null, + "docstring": null + }, + "surgeryType": { + "name": "surgeryType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.surgeryType", + "signature": null, + "docstring": null + }, + "complications": { + "name": "complications", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.complications", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNotes": { + "name": "ProcedureNotes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNotes", + "signature": null, + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Procedure", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.name", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.description", + "signature": null, + "docstring": null + }, + "cost": { + "name": "cost", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.cost", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.notes", + "signature": null, + "docstring": null + } + } + }, + "TreatmentBase": { + "name": "TreatmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentBase", + "signature": "", + "docstring": null, + "members": { + "label": { + "name": "label", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.label", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.description", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Treatment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Treatment.id", + "signature": null, + "docstring": null + } + } + }, + "PetBase": { + "name": "PetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.name", + "signature": null, + "docstring": null + }, + "species": { + "name": "species", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.species", + "signature": null, + "docstring": null + }, + "age": { + "name": "age", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.age", + "signature": null, + "docstring": null + }, + "weight": { + "name": "weight", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.weight", + "signature": null, + "docstring": null + }, + "birthDate": { + "name": "birthDate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.birthDate", + "signature": null, + "docstring": null + }, + "photo": { + "name": "photo", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.photo", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "PetCreate": { + "name": "PetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetCreate", + "signature": "", + "docstring": null, + "members": { + "parent_ids": { + "name": "parent_ids", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetCreate.parent_ids", + "signature": null, + "docstring": null + } + } + }, + "Pet": { + "name": "Pet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Pet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.id", + "signature": null, + "docstring": null + }, + "parents": { + "name": "parents", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.parents", + "signature": null, + "docstring": null + } + } + }, + "AppointmentBase": { + "name": "AppointmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentBase", + "signature": "", + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.date", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.notes", + "signature": null, + "docstring": null + }, + "procedures": { + "name": "procedures", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.procedures", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate", + "signature": "", + "docstring": null, + "members": { + "pet_id": { + "name": "pet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.pet_id", + "signature": null, + "docstring": null + }, + "vet_id": { + "name": "vet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.vet_id", + "signature": null, + "docstring": null + }, + "treatment_id": { + "name": "treatment_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.treatment_id", + "signature": null, + "docstring": null + } + } + }, + "Appointment": { + "name": "Appointment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Appointment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.id", + "signature": null, + "docstring": null + }, + "pet": { + "name": "pet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.pet", + "signature": null, + "docstring": null + }, + "vet": { + "name": "vet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.vet", + "signature": null, + "docstring": null + }, + "treatment": { + "name": "treatment", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.treatment", + "signature": null, + "docstring": null + } + } + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.vet_app.routes", + "signature": null, + "docstring": "Veterinary Clinic route handlers bound via OpenAPI operationId.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "UploadFile": { + "name": "UploadFile", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.UploadFile", + "signature": "", + "docstring": null + }, + "StreamingResponse": { + "name": "StreamingResponse", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.StreamingResponse", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.unsubscribe", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.ParentCreate", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.VetCreate", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.TreatmentCreate", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.PetCreate", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_parents", + "signature": "", + "docstring": "List parents (paginated).\n\nParameters\n----------\nlimit : int\n Maximum number of records to return.\noffset : int\n Number of records to skip.\n\nReturns\n-------\ndict\n Paginated response with ``total`` and ``items``." + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_parent", + "signature": "", + "docstring": "Create a parent.\n\nParameters\n----------\npayload : ParentCreate\n Parent data excluding the ``id`` field.\n\nReturns\n-------\nParent\n The newly created parent." + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_parent", + "signature": "", + "docstring": "Retrieve a single parent by ID.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nReturns\n-------\nParent\n The requested parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_parent", + "signature": "", + "docstring": "Update an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\npayload : ParentCreate\n Updated parent data.\n\nReturns\n-------\nParent\n The updated parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_parent", + "signature": "", + "docstring": "Delete an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_vets", + "signature": "", + "docstring": "List vets (paginated)." + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_vet", + "signature": "", + "docstring": "Create a vet." + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_vet", + "signature": "", + "docstring": "Retrieve a single vet by ID." + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_vet", + "signature": "", + "docstring": "Update an existing vet." + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_vet", + "signature": "", + "docstring": "Delete an existing vet." + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_treatments", + "signature": "", + "docstring": "List treatments (catalogue).\n\nReturns\n-------\nlist[Treatment]\n A list of treatment domain objects." + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_treatment", + "signature": "", + "docstring": "Add a treatment (admin only)." + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_treatment", + "signature": "", + "docstring": "Retrieve a single treatment by ID." + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_treatment", + "signature": "", + "docstring": "Update an existing treatment." + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_treatment", + "signature": "", + "docstring": "Delete an existing treatment." + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_pets", + "signature": "", + "docstring": "List pets (paginated)." + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_pet", + "signature": "", + "docstring": "Create a pet." + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_pet", + "signature": "", + "docstring": "Retrieve a single pet by ID." + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_pet", + "signature": "", + "docstring": "Update an existing pet." + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_pet", + "signature": "", + "docstring": "Delete an existing pet." + }, + "upload_pet_photo": { + "name": "upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.upload_pet_photo", + "signature": "", + "docstring": "Upload a pet photo.\n\nParameters\n----------\nid : int\n Identifier of the pet.\nfile : UploadFile\n Image file to upload.\n\nReturns\n-------\ndict\n A confirmation with the pet ID." + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_appointments", + "signature": "", + "docstring": "List appointments (paginated, filterable)." + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_appointment", + "signature": "", + "docstring": "Create an appointment." + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_appointment", + "signature": "", + "docstring": "Retrieve a single appointment by ID." + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_appointment", + "signature": "", + "docstring": "Update an existing appointment." + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_appointment", + "signature": "", + "docstring": "Delete an existing appointment." + }, + "stream_actions": { + "name": "stream_actions", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.stream_actions", + "signature": "", + "docstring": "Stream animal actions via SSE, scoped to a pet's species." + } + } + }, + "sse": { + "name": "sse", + "kind": "module", + "path": "openapi_first.templates.vet_app.sse", + "signature": null, + "docstring": null, + "members": { + "asyncio": { + "name": "asyncio", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.asyncio", + "signature": "", + "docstring": null + }, + "random": { + "name": "random", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.random", + "signature": "", + "docstring": null + }, + "json": { + "name": "json", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.json", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.unsubscribe", + "signature": "", + "docstring": null + } + } + }, + "test_vet_app": { + "name": "test_vet_app", + "kind": "module", + "path": "openapi_first.templates.vet_app.test_vet_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first Veterinary Clinic example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "test_client": { + "name": "test_client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.test_client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.spec", + "signature": null, + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.client", + "signature": null, + "docstring": null + }, + "test_list_parents": { + "name": "test_list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_parents", + "signature": "", + "docstring": "List parents returns paginated response." + }, + "test_create_parent": { + "name": "test_create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_parent", + "signature": "", + "docstring": "Creating a parent returns 201 with the created entity." + }, + "test_get_parent": { + "name": "test_get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_get_parent", + "signature": "", + "docstring": "Get parent by ID returns the entity." + }, + "test_update_parent": { + "name": "test_update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_update_parent", + "signature": "", + "docstring": "Update parent replaces its values." + }, + "test_delete_parent": { + "name": "test_delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_delete_parent", + "signature": "", + "docstring": "Delete parent returns 204 and removes the entity." + }, + "test_list_vets": { + "name": "test_list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_vets", + "signature": "", + "docstring": "List vets returns paginated response." + }, + "test_create_vet": { + "name": "test_create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_vet", + "signature": "", + "docstring": "Creating a vet returns 201." + }, + "test_list_treatments": { + "name": "test_list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_treatments", + "signature": "", + "docstring": "List treatments returns an array." + }, + "test_create_treatment": { + "name": "test_create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_treatment", + "signature": "", + "docstring": "Creating a treatment returns 201." + }, + "test_create_pet": { + "name": "test_create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_pet", + "signature": "", + "docstring": "Creating a pet links FK references." + }, + "test_upload_pet_photo": { + "name": "test_upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_upload_pet_photo", + "signature": "", + "docstring": "Upload pet photo returns 200." + }, + "test_list_appointments": { + "name": "test_list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_appointments", + "signature": "", + "docstring": "List appointments returns paginated response with filter params." + }, + "test_full_appointment_lifecycle": { + "name": "test_full_appointment_lifecycle", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_full_appointment_lifecycle", + "signature": "", + "docstring": "Create a parent, vet, treatment, pet, then an appointment." + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.loader.json b/docs/mcp/modules/openapi_first.loader.json similarity index 89% rename from mcp_docs/modules/openapi_first.loader.json rename to docs/mcp/modules/openapi_first.loader.json index d6a93be..0193335 100644 --- a/mcp_docs/modules/openapi_first.loader.json +++ b/docs/mcp/modules/openapi_first.loader.json @@ -50,29 +50,15 @@ "name": "OpenAPISpecLoadError", "kind": "class", "path": "openapi_first.loader.OpenAPISpecLoadError", - "signature": "", + "signature": "", "docstring": "Raised when an OpenAPI specification cannot be loaded or validated.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the OpenAPI document is unreadable,\n malformed, or violates the OpenAPI 3.x specification." }, "load_openapi": { "name": "load_openapi", "kind": "function", "path": "openapi_first.loader.load_openapi", - "signature": "", + "signature": "", "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.loader.Dict", - "signature": "", - "docstring": null - }, - "Union": { - "name": "Union", - "kind": "alias", - "path": "openapi_first.loader.Union", - "signature": "", - "docstring": null } } } diff --git a/docs/mcp/modules/openapi_first.security.json b/docs/mcp/modules/openapi_first.security.json new file mode 100644 index 0000000..ac2fd9e --- /dev/null +++ b/docs/mcp/modules/openapi_first.security.json @@ -0,0 +1,93 @@ +{ + "module": "openapi_first.security", + "content": { + "path": "openapi_first.security", + "docstring": "OpenAPI security scheme parsing and auto-generated auth dependencies.\n\nReads `securitySchemes` and per-operation `security` from an OpenAPI spec,\nresolves `{ENV_VAR}` placeholders in `x-` extension fields, and generates\nFastAPI dependencies for token validation (e.g., Bearer JWT introspection).", + "objects": { + "os": { + "name": "os", + "kind": "alias", + "path": "openapi_first.security.os", + "signature": "", + "docstring": null + }, + "re": { + "name": "re", + "kind": "alias", + "path": "openapi_first.security.re", + "signature": "", + "docstring": null + }, + "Callable": { + "name": "Callable", + "kind": "alias", + "path": "openapi_first.security.Callable", + "signature": "", + "docstring": null + }, + "Any": { + "name": "Any", + "kind": "alias", + "path": "openapi_first.security.Any", + "signature": "", + "docstring": null + }, + "httpx": { + "name": "httpx", + "kind": "alias", + "path": "openapi_first.security.httpx", + "signature": "", + "docstring": null + }, + "Depends": { + "name": "Depends", + "kind": "alias", + "path": "openapi_first.security.Depends", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.security.HTTPException", + "signature": "", + "docstring": null + }, + "Request": { + "name": "Request", + "kind": "alias", + "path": "openapi_first.security.Request", + "signature": "", + "docstring": null + }, + "HTTPAuthorizationCredentials": { + "name": "HTTPAuthorizationCredentials", + "kind": "alias", + "path": "openapi_first.security.HTTPAuthorizationCredentials", + "signature": "", + "docstring": null + }, + "HTTPBearer": { + "name": "HTTPBearer", + "kind": "alias", + "path": "openapi_first.security.HTTPBearer", + "signature": "", + "docstring": null + }, + "parse_security_schemes": { + "name": "parse_security_schemes", + "kind": "function", + "path": "openapi_first.security.parse_security_schemes", + "signature": "", + "docstring": "Extract and resolve environment variables in security schemes." + }, + "make_security_dependencies": { + "name": "make_security_dependencies", + "kind": "function", + "path": "openapi_first.security.make_security_dependencies", + "signature": "", + "docstring": "Build a mapping of ``METHOD:/path`` → list of ``Depends(...)``.\n\nThe effective security for each operation is resolved by:\n\n1. Using the operation-level ``security`` field if present.\n2. Falling back to the top-level ``security`` field.\n3. An empty list means *no auth required* for that operation." + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.templates.crud_app.data.json b/docs/mcp/modules/openapi_first.templates.crud_app.data.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.crud_app.data.json rename to docs/mcp/modules/openapi_first.templates.crud_app.data.json diff --git a/mcp_docs/modules/openapi_first.templates.crud_app.json b/docs/mcp/modules/openapi_first.templates.crud_app.json similarity index 96% rename from mcp_docs/modules/openapi_first.templates.crud_app.json rename to docs/mcp/modules/openapi_first.templates.crud_app.json index bf8e480..9baef63 100644 --- a/mcp_docs/modules/openapi_first.templates.crud_app.json +++ b/docs/mcp/modules/openapi_first.templates.crud_app.json @@ -67,7 +67,7 @@ "kind": "class", "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp", "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.templates.crud_app.main.json b/docs/mcp/modules/openapi_first.templates.crud_app.main.json similarity index 79% rename from mcp_docs/modules/openapi_first.templates.crud_app.main.json rename to docs/mcp/modules/openapi_first.templates.crud_app.main.json index 161ce88..94afe60 100644 --- a/mcp_docs/modules/openapi_first.templates.crud_app.main.json +++ b/docs/mcp/modules/openapi_first.templates.crud_app.main.json @@ -9,7 +9,7 @@ "kind": "class", "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp", "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.templates.crud_app.routes.json b/docs/mcp/modules/openapi_first.templates.crud_app.routes.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.crud_app.routes.json rename to docs/mcp/modules/openapi_first.templates.crud_app.routes.json diff --git a/mcp_docs/modules/openapi_first.templates.crud_app.test_crud_app.json b/docs/mcp/modules/openapi_first.templates.crud_app.test_crud_app.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.crud_app.test_crud_app.json rename to docs/mcp/modules/openapi_first.templates.crud_app.test_crud_app.json diff --git a/mcp_docs/modules/openapi_first.templates.health_app.json b/docs/mcp/modules/openapi_first.templates.health_app.json similarity index 90% rename from mcp_docs/modules/openapi_first.templates.health_app.json rename to docs/mcp/modules/openapi_first.templates.health_app.json index 21fee38..3a7dcfe 100644 --- a/mcp_docs/modules/openapi_first.templates.health_app.json +++ b/docs/mcp/modules/openapi_first.templates.health_app.json @@ -16,7 +16,7 @@ "kind": "class", "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp", "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.templates.health_app.main.json b/docs/mcp/modules/openapi_first.templates.health_app.main.json similarity index 79% rename from mcp_docs/modules/openapi_first.templates.health_app.main.json rename to docs/mcp/modules/openapi_first.templates.health_app.main.json index 8dd6b99..6f2c9d5 100644 --- a/mcp_docs/modules/openapi_first.templates.health_app.main.json +++ b/docs/mcp/modules/openapi_first.templates.health_app.main.json @@ -9,7 +9,7 @@ "kind": "class", "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp", "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.templates.health_app.routes.json b/docs/mcp/modules/openapi_first.templates.health_app.routes.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.health_app.routes.json rename to docs/mcp/modules/openapi_first.templates.health_app.routes.json diff --git a/docs/mcp/modules/openapi_first.templates.json b/docs/mcp/modules/openapi_first.templates.json new file mode 100644 index 0000000..353040a --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.json @@ -0,0 +1,2274 @@ +{ + "module": "openapi_first.templates", + "content": { + "path": "openapi_first.templates", + "docstring": "Application templates for FastAPI OpenAPI First.\n\nThis package contains example and scaffolding templates intended to be\ncopied into user projects via the ``openapi-first`` CLI.\n\nTemplates in this package are:\n- Reference implementations of OpenAPI-first services\n- Not part of the ``openapi_first`` public or internal API\n- Not intended to be imported as runtime dependencies\n\nThe presence of this file exists solely to:\n- Mark the directory as an explicit Python package\n- Enable deterministic tooling behavior (documentation, packaging)\n- Avoid accidental traversal of non-package directories\n\nNo code in this package should be imported by library consumers.", + "objects": { + "crud_app": { + "name": "crud_app", + "kind": "module", + "path": "openapi_first.templates.crud_app", + "signature": null, + "docstring": "OpenAPI-first CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new CRUD example service using the bundled template:\n\n openapi-first crud_app\n\nCreate the service in a custom directory:\n\n openapi-first crud_app my-crud-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "members": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.crud_app.data", + "signature": null, + "docstring": "In-memory mock data store for CRUD example.\n\nThis module intentionally avoids persistence and concurrency guarantees.\nIt is suitable for demos, tests, and scaffolding only.\n\nIt intentionally avoids\n- persistence\n- concurrency guarantees\n- validation\n- error handling\n\nThe implementation is suitable for:\n- demonstrations\n- tests\n- scaffolding and example services\n\nIt is explicitly NOT suitable for production use.\n\nThis module is not part of the ``openapi_first`` library API surface.", + "members": { + "Dict": { + "name": "Dict", + "kind": "alias", + "path": "openapi_first.templates.crud_app.data.Dict", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.list_items", + "signature": "", + "docstring": "Return all items in the data store.\n\nThis function performs no filtering, pagination, or sorting.\nThe returned collection reflects the current in-memory state.\n\nReturns\n-------\nlist[dict]\n A list of item representations." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present in the store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The stored item representation." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.create_item", + "signature": "", + "docstring": "Create a new item in the data store.\n\nA new integer ID is assigned automatically. No validation is\nperformed on the provided payload.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The newly created item, including its assigned ID." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.update_item", + "signature": "", + "docstring": "Replace an existing item in the data store.\n\nThis function overwrites the existing item entirely and does not\nperform partial updates or validation. If the item does not exist,\nit will be created implicitly.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item representation." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.data.delete_item", + "signature": "", + "docstring": "Remove an item from the data store.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete." + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.crud_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.crud_app.main.routes", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.crud_app.routes", + "signature": null, + "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThese handlers explicitly control HTTP status codes to ensure\nruntime behavior matches the OpenAPI contract.\n\nThis module defines OpenAPI-bound operation handlers for a simple CRUD\nservice. Functions in this module are bound to HTTP routes exclusively\nvia OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Error conditions are translated\ninto explicit HTTP responses rather than relying on implicit framework\nbehavior.\n\nNo routing decorators or path definitions appear in this module. All\nrouting, HTTP methods, and schemas are defined in the OpenAPI\nspecification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.crud_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.crud_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.list_items", + "signature": "", + "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[dict]\n A list of item representations." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.create_item", + "signature": "", + "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\ndict\n The newly created item." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.update_item", + "signature": "", + "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.routes.delete_item", + "signature": "", + "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + } + } + }, + "test_crud_app": { + "name": "test_crud_app", + "kind": "module", + "path": "openapi_first.templates.crud_app.test_crud_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Correct HTTP status codes and response payloads\n\nThe tests exercise all CRUD operations against an in-memory mock data\nstore and assume deterministic behavior within a single process.\n\nThe tests assume:\n- OpenAPI-first route binding\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process\n- One-to-one correspondence between OpenAPI operationId values and\n server/client callables", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.crud_app.test_crud_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.crud_app.test_crud_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.crud_app.test_crud_app.spec", + "signature": null, + "docstring": null + }, + "test_list_items_initial": { + "name": "test_list_items_initial", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_list_items_initial", + "signature": "", + "docstring": "Initial items should be present." + }, + "test_get_item": { + "name": "test_get_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_get_item", + "signature": "", + "docstring": "Existing item should be retrievable by ID." + }, + "test_create_item": { + "name": "test_create_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_create_item", + "signature": "", + "docstring": "Creating a new item should return the created entity." + }, + "test_update_item": { + "name": "test_update_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_update_item", + "signature": "", + "docstring": "Updating an item should replace its values." + }, + "test_delete_item": { + "name": "test_delete_item", + "kind": "function", + "path": "openapi_first.templates.crud_app.test_crud_app.test_delete_item", + "signature": "", + "docstring": "Deleting an item should remove it from the store." + } + } + } + } + }, + "health_app": { + "name": "health_app", + "kind": "module", + "path": "openapi_first.templates.health_app", + "signature": null, + "docstring": "OpenAPI-first FastAPI application template.\n\nThis package contains a minimal, fully working example of an\nOpenAPI-first FastAPI service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace (``routes``)\n\nNo routing decorators, implicit behavior, or framework-specific\nconvenience abstractions are used. All HTTP routes, methods, and\noperation bindings are defined in OpenAPI and enforced at application\nstartup.\n\nThis package is intended to be copied as a starting point for new\nservices via the ``openapi-first`` CLI. It is not part of the\n``openapi_first`` library API surface.\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new OpenAPI-first health check service using the bundled\ntemplate:\n\n openapi-first health_app\n\nCreate the service in a custom directory:\n\n openapi-first health_app my-health-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client call for the ``get_health`` operation:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n response = client.get_health()\n\n assert response.status_code == 200\n assert response.json() == {\"status\": \"ok\"}\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time", + "members": { + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.health_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first FastAPI service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, and operation bindings are defined in the\nOpenAPI document referenced by ``openapi_path``. Python callables\ndefined in the ``routes`` module are bound to OpenAPI operations\nstrictly via ``operationId``.\n\nThis module contains no routing logic, request handling, or framework\nconfiguration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.health_app.main.routes", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.health_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.health_app.routes", + "signature": null, + "docstring": "OpenAPI operation handlers.\n\nThis module defines pure Python callables that implement OpenAPI\noperations for this service. Functions in this module are bound to HTTP\nroutes exclusively via OpenAPI ``operationId`` values.\n\nNo routing decorators, HTTP metadata, or framework-specific logic\nshould appear here. All request/response semantics are defined in the\nOpenAPI specification.\n\nThis module serves solely as an operationId namespace.", + "members": { + "get_health": { + "name": "get_health", + "kind": "function", + "path": "openapi_first.templates.health_app.routes.get_health", + "signature": "", + "docstring": "Health check operation handler.\n\nThis function implements the OpenAPI operation identified by\n``operationId: get_health``.\n\nIt contains no routing metadata or framework-specific logic.\nRequest binding, HTTP method, and response semantics are defined\nexclusively by the OpenAPI specification.\n\nReturns\n-------\ndict\n A minimal liveness payload indicating service health." + } + } + } + } + }, + "model_app": { + "name": "model_app", + "kind": "module", + "path": "openapi_first.templates.model_app", + "signature": null, + "docstring": "OpenAPI-first model-based CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service that uses explicit Pydantic domain models for request and\nresponse schemas.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- Pydantic domain models (``models``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit request and response modeling with Pydantic\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new model-based CRUD example service using the bundled template:\n\n openapi-first model_app\n\nCreate the service in a custom directory:\n\n openapi-first model_app my-model-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for model-based CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Request and response payloads conform to Pydantic models\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "members": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.model_app.data", + "signature": null, + "docstring": "In-memory data store using Pydantic models.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\nThis module provides a minimal, process-local data store for the\nmodel-based CRUD example application. It stores and returns domain\nobjects defined using Pydantic models and is intended solely for\ndemonstration and scaffolding purposes.\n\nThe implementation intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nIt is not part of the ``openapi_first`` library API surface.", + "members": { + "Dict": { + "name": "Dict", + "kind": "alias", + "path": "openapi_first.templates.model_app.data.Dict", + "signature": "", + "docstring": null + }, + "Item": { + "name": "Item", + "kind": "alias", + "path": "openapi_first.templates.model_app.data.Item", + "signature": "", + "docstring": null + }, + "ItemCreate": { + "name": "ItemCreate", + "kind": "alias", + "path": "openapi_first.templates.model_app.data.ItemCreate", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.model_app.data.list_items", + "signature": "", + "docstring": "Return all items in the data store.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nKeyError\n If the item does not exist." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.create_item", + "signature": "", + "docstring": "Create a new item in the data store.\n\nA new identifier is assigned automatically. No additional validation\nis performed beyond Pydantic model validation.\n\nParameters\n----------\npayload : ItemCreate\n Data required to create a new item.\n\nReturns\n-------\nItem\n The newly created item." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.update_item", + "signature": "", + "docstring": "Replace an existing item in the data store.\n\nThis function performs a full replacement of the stored item.\nPartial updates are not supported.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nKeyError\n If the item does not exist." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.model_app.data.delete_item", + "signature": "", + "docstring": "Remove an item from the data store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\n\nRaises\n------\nKeyError\n If the item does not exist." + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.model_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first model-based CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.model_app.main.routes", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.model_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "models": { + "name": "models", + "kind": "module", + "path": "openapi_first.templates.model_app.models", + "signature": null, + "docstring": "Pydantic domain models for the CRUD example.\n\nThis module defines Pydantic models that represent the domain entities\nused by the service. These models are referenced by the OpenAPI\nspecification for request and response schemas.\n\nThe models are declarative and framework-agnostic. They contain no\npersistence logic, validation beyond type constraints, or business\nbehavior.\n\nThis module is not part of the ``openapi_first`` library API surface.\nIt exists solely to support the example application template.", + "members": { + "BaseModel": { + "name": "BaseModel", + "kind": "alias", + "path": "openapi_first.templates.model_app.models.BaseModel", + "signature": "", + "docstring": null + }, + "ItemBase": { + "name": "ItemBase", + "kind": "class", + "path": "openapi_first.templates.model_app.models.ItemBase", + "signature": "", + "docstring": "Base domain model for an item.\n\nDefines fields common to all item representations.", + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.model_app.models.ItemBase.name", + "signature": null, + "docstring": null + }, + "price": { + "name": "price", + "kind": "attribute", + "path": "openapi_first.templates.model_app.models.ItemBase.price", + "signature": null, + "docstring": null + } + } + }, + "ItemCreate": { + "name": "ItemCreate", + "kind": "class", + "path": "openapi_first.templates.model_app.models.ItemCreate", + "signature": "", + "docstring": "Domain model for item creation requests.\n\nThis model is used for request bodies when creating new items.\nIt intentionally excludes the ``id`` field, which is assigned\nby the service." + }, + "Item": { + "name": "Item", + "kind": "class", + "path": "openapi_first.templates.model_app.models.Item", + "signature": "", + "docstring": "Domain model for a persisted item.\n\nThis model represents the full item state returned in responses,\nincluding the server-assigned identifier.", + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.model_app.models.Item.id", + "signature": null, + "docstring": null + } + } + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.model_app.routes", + "signature": null, + "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThis module defines OpenAPI-bound operation handlers for a model-based\nCRUD service. Functions in this module are bound to HTTP routes\nexclusively via OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.model_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.model_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "ItemCreate": { + "name": "ItemCreate", + "kind": "alias", + "path": "openapi_first.templates.model_app.routes.ItemCreate", + "signature": "", + "docstring": null + }, + "list_items": { + "name": "list_items", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.list_items", + "signature": "", + "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." + }, + "get_item": { + "name": "get_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.get_item", + "signature": "", + "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "create_item": { + "name": "create_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.create_item", + "signature": "", + "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : ItemCreate\n Request body describing the item to create.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nItem\n The newly created item." + }, + "update_item": { + "name": "update_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.update_item", + "signature": "", + "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + }, + "delete_item": { + "name": "delete_item", + "kind": "function", + "path": "openapi_first.templates.model_app.routes.delete_item", + "signature": "", + "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." + } + } + }, + "test_model_app": { + "name": "test_model_app", + "kind": "module", + "path": "openapi_first.templates.model_app.test_model_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first model CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Pydantic model-based request and response handling\n\nAll CRUD operations are exercised against an in-memory mock data store\nbacked by Pydantic domain models.\n\nThe tests assume:\n- OpenAPI-first route binding\n- Pydantic model validation\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.model_app.test_model_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.model_app.test_model_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.model_app.test_model_app.spec", + "signature": null, + "docstring": null + }, + "test_list_items_initial": { + "name": "test_list_items_initial", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_list_items_initial", + "signature": "", + "docstring": "Initial items should be present." + }, + "test_get_item": { + "name": "test_get_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_get_item", + "signature": "", + "docstring": "Existing item should be retrievable by ID." + }, + "test_create_item": { + "name": "test_create_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_create_item", + "signature": "", + "docstring": "Creating a new item should return the created entity." + }, + "test_update_item": { + "name": "test_update_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_update_item", + "signature": "", + "docstring": "Updating an item should replace its values." + }, + "test_delete_item": { + "name": "test_delete_item", + "kind": "function", + "path": "openapi_first.templates.model_app.test_model_app.test_delete_item", + "signature": "", + "docstring": "Deleting an item should remove it from the store." + } + } + } + } + }, + "vet_app": { + "name": "vet_app", + "kind": "module", + "path": "openapi_first.templates.vet_app", + "signature": null, + "docstring": "OpenAPI-first Veterinary Clinic application template.\n\nThis package contains a complete, runnable example of an OpenAPI-first\nveterinary clinic management service. It demonstrates all ``x-`` extension\nfields consumed by the ``react-openapi`` admin panel renderer.\n\nThe application manages five resources:\n\n- **Parents** — pet owners with contact details\n- **Vets** — veterinarians with specializations\n- **Treatments** — medical procedure catalog\n- **Pets** — animals with species, age, weight, and photos\n- **Appointments** — scheduled visits linking pets, vets, and treatments\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification (``openapi.yaml``). Every operation has an\nexplicit ``operationId`` that maps to a Python handler in ``routes.py``.\n\nThis file is a copyable template. It is not part of the ``openapi_first``\nlibrary API surface.\n\n----------------------------------------------------------------------\nOpenAPI x- extension fields demonstrated\n----------------------------------------------------------------------\n\nSchema-level extensions (display metadata for resource endpoints):\n\n ``x-primary-key`` (REQUIRED) Primary key property name\n ``x-display-format`` (REQUIRED) Human-readable label template\n ``x-list-columns`` (REQUIRED) Columns for the datatable\n\nProperty-level extensions (control UI rendering):\n\n ``x-label`` (REQUIRED) Human-readable field label\n ``x-order`` (REQUIRED) Field ordering in forms/detail\n ``x-description`` (optional) Helper text below form fields\n ``x-hidden`` (optional) Visibility in form / list / detail\n ``x-filterable`` (optional) Allows column filtering\n ``x-sortable`` (optional) Allows column sorting\n ``x-fk`` (optional) Foreign key — renders as dropdown\n ``x-fk.resource`` (REQUIRED for FK) Target resource name\n ``x-fk.prefetch`` (optional) Preload all FK options on mount\n ``x-ui-type`` (optional) Custom UI type (e.g. image upload)\n ``x-upload-url`` (optional) Upload endpoint for binary fields\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new vet clinic service using the bundled template:\n\n openapi-first vet_app\n\nCreate the service in a custom directory:\n\n openapi-first vet_app my-vet-clinic\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List pets with pagination\n response = client.list_pets(query_params={\"limit\": 10, \"offset\": 0})\n\n # Create a pet with FK references\n response = client.create_pet(\n body={\"name\": \"Fido\", \"species\": \"dog\", \"parents\": [1, 2]}\n )\n\n # Upload a pet photo\n response = client.upload_pet_photo(\n path_params={\"id\": 1},\n body={\"file\": open(\"photo.jpg\", \"rb\")},\n )\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "members": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.vet_app.data", + "signature": null, + "docstring": "In-memory data store for the Veterinary Clinic example.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\n\nIt provides minimal, process-local data stores for the five veterinary\nclinic entities. Each store exposes standard CRUD operations backed by\na simple dictionary.\n\nThis module intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nThis module is not part of the ``openapi_first`` library API surface.", + "members": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.datetime", + "signature": "", + "docstring": null + }, + "timezone": { + "name": "timezone", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.timezone", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Parent", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.ParentCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Vet", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VetCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Treatment", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Procedure", + "signature": "", + "docstring": null + }, + "BasicNote": { + "name": "BasicNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.BasicNote", + "signature": "", + "docstring": null + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.HeartRateNote", + "signature": "", + "docstring": null + }, + "DentalNote": { + "name": "DentalNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.DentalNote", + "signature": "", + "docstring": null + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VaccineNote", + "signature": "", + "docstring": null + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PreOpNote", + "signature": "", + "docstring": null + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.SurgeryNote", + "signature": "", + "docstring": null + }, + "Pet": { + "name": "Pet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Pet", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PetCreate", + "signature": "", + "docstring": null + }, + "Appointment": { + "name": "Appointment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Appointment", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_parents", + "signature": "", + "docstring": null + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_parent", + "signature": "", + "docstring": null + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_parent", + "signature": "", + "docstring": null + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_parent", + "signature": "", + "docstring": null + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_parent", + "signature": "", + "docstring": null + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_vets", + "signature": "", + "docstring": null + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_vet", + "signature": "", + "docstring": null + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_vet", + "signature": "", + "docstring": null + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_vet", + "signature": "", + "docstring": null + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_vet", + "signature": "", + "docstring": null + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_treatments", + "signature": "", + "docstring": null + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_treatment", + "signature": "", + "docstring": null + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_treatment", + "signature": "", + "docstring": null + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_treatment", + "signature": "", + "docstring": null + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_treatment", + "signature": "", + "docstring": null + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_pets", + "signature": "", + "docstring": null + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_pet", + "signature": "", + "docstring": null + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_pet", + "signature": "", + "docstring": null + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_pet", + "signature": "", + "docstring": null + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_pet", + "signature": "", + "docstring": null + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_appointments", + "signature": "", + "docstring": null + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_appointment", + "signature": "", + "docstring": null + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_appointment", + "signature": "", + "docstring": null + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_appointment", + "signature": "", + "docstring": null + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_appointment", + "signature": "", + "docstring": null + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.vet_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first Veterinary Clinic service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "asynccontextmanager": { + "name": "asynccontextmanager", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.asynccontextmanager", + "signature": "", + "docstring": null + }, + "CORSMiddleware": { + "name": "CORSMiddleware", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.CORSMiddleware", + "signature": "", + "docstring": null + }, + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.routes", + "signature": "", + "docstring": null + }, + "lifespan": { + "name": "lifespan", + "kind": "function", + "path": "openapi_first.templates.vet_app.main.lifespan", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "models": { + "name": "models", + "kind": "module", + "path": "openapi_first.templates.vet_app.models", + "signature": null, + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.datetime", + "signature": "", + "docstring": null + }, + "Annotated": { + "name": "Annotated", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Annotated", + "signature": "", + "docstring": null + }, + "Literal": { + "name": "Literal", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Literal", + "signature": "", + "docstring": null + }, + "BaseModel": { + "name": "BaseModel", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.BaseModel", + "signature": "", + "docstring": null + }, + "Field": { + "name": "Field", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Field", + "signature": "", + "docstring": null + }, + "Metadata": { + "name": "Metadata", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Metadata", + "signature": "", + "docstring": null, + "members": { + "createdOn": { + "name": "createdOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.createdOn", + "signature": null, + "docstring": null + }, + "updatedOn": { + "name": "updatedOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.updatedOn", + "signature": null, + "docstring": null + } + } + }, + "ParentBase": { + "name": "ParentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.name", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentCreate", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Parent", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Parent.id", + "signature": null, + "docstring": null + } + } + }, + "VetBase": { + "name": "VetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.name", + "signature": null, + "docstring": null + }, + "specialty": { + "name": "specialty", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.specialty", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "VetCreate": { + "name": "VetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Vet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Vet.id", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNoteBase": { + "name": "ProcedureNoteBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase", + "signature": "", + "docstring": null, + "members": { + "summary": { + "name": "summary", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.summary", + "signature": null, + "docstring": null + }, + "details": { + "name": "details", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.details", + "signature": null, + "docstring": null + } + } + }, + "BasicNote": { + "name": "BasicNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.BasicNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.BasicNote.noteType", + "signature": null, + "docstring": null + } + } + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.HeartRateNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.noteType", + "signature": null, + "docstring": null + }, + "bpm": { + "name": "bpm", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.bpm", + "signature": null, + "docstring": null + } + } + }, + "DentalNote": { + "name": "DentalNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.DentalNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.noteType", + "signature": null, + "docstring": null + }, + "procedureType": { + "name": "procedureType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.procedureType", + "signature": null, + "docstring": null + }, + "teeth": { + "name": "teeth", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.teeth", + "signature": null, + "docstring": null + } + } + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VaccineNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.noteType", + "signature": null, + "docstring": null + }, + "medicine": { + "name": "medicine", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.medicine", + "signature": null, + "docstring": null + }, + "leg": { + "name": "leg", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.leg", + "signature": null, + "docstring": null + } + } + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PreOpNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.noteType", + "signature": null, + "docstring": null + }, + "heartRate": { + "name": "heartRate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.heartRate", + "signature": null, + "docstring": null + }, + "temperature": { + "name": "temperature", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.temperature", + "signature": null, + "docstring": null + } + } + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.SurgeryNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.noteType", + "signature": null, + "docstring": null + }, + "surgeryType": { + "name": "surgeryType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.surgeryType", + "signature": null, + "docstring": null + }, + "complications": { + "name": "complications", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.complications", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNotes": { + "name": "ProcedureNotes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNotes", + "signature": null, + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Procedure", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.name", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.description", + "signature": null, + "docstring": null + }, + "cost": { + "name": "cost", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.cost", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.notes", + "signature": null, + "docstring": null + } + } + }, + "TreatmentBase": { + "name": "TreatmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentBase", + "signature": "", + "docstring": null, + "members": { + "label": { + "name": "label", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.label", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.description", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Treatment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Treatment.id", + "signature": null, + "docstring": null + } + } + }, + "PetBase": { + "name": "PetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.name", + "signature": null, + "docstring": null + }, + "species": { + "name": "species", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.species", + "signature": null, + "docstring": null + }, + "age": { + "name": "age", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.age", + "signature": null, + "docstring": null + }, + "weight": { + "name": "weight", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.weight", + "signature": null, + "docstring": null + }, + "birthDate": { + "name": "birthDate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.birthDate", + "signature": null, + "docstring": null + }, + "photo": { + "name": "photo", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.photo", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "PetCreate": { + "name": "PetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetCreate", + "signature": "", + "docstring": null, + "members": { + "parent_ids": { + "name": "parent_ids", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetCreate.parent_ids", + "signature": null, + "docstring": null + } + } + }, + "Pet": { + "name": "Pet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Pet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.id", + "signature": null, + "docstring": null + }, + "parents": { + "name": "parents", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.parents", + "signature": null, + "docstring": null + } + } + }, + "AppointmentBase": { + "name": "AppointmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentBase", + "signature": "", + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.date", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.notes", + "signature": null, + "docstring": null + }, + "procedures": { + "name": "procedures", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.procedures", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate", + "signature": "", + "docstring": null, + "members": { + "pet_id": { + "name": "pet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.pet_id", + "signature": null, + "docstring": null + }, + "vet_id": { + "name": "vet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.vet_id", + "signature": null, + "docstring": null + }, + "treatment_id": { + "name": "treatment_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.treatment_id", + "signature": null, + "docstring": null + } + } + }, + "Appointment": { + "name": "Appointment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Appointment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.id", + "signature": null, + "docstring": null + }, + "pet": { + "name": "pet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.pet", + "signature": null, + "docstring": null + }, + "vet": { + "name": "vet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.vet", + "signature": null, + "docstring": null + }, + "treatment": { + "name": "treatment", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.treatment", + "signature": null, + "docstring": null + } + } + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.vet_app.routes", + "signature": null, + "docstring": "Veterinary Clinic route handlers bound via OpenAPI operationId.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "UploadFile": { + "name": "UploadFile", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.UploadFile", + "signature": "", + "docstring": null + }, + "StreamingResponse": { + "name": "StreamingResponse", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.StreamingResponse", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.unsubscribe", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.ParentCreate", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.VetCreate", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.TreatmentCreate", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.PetCreate", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_parents", + "signature": "", + "docstring": "List parents (paginated).\n\nParameters\n----------\nlimit : int\n Maximum number of records to return.\noffset : int\n Number of records to skip.\n\nReturns\n-------\ndict\n Paginated response with ``total`` and ``items``." + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_parent", + "signature": "", + "docstring": "Create a parent.\n\nParameters\n----------\npayload : ParentCreate\n Parent data excluding the ``id`` field.\n\nReturns\n-------\nParent\n The newly created parent." + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_parent", + "signature": "", + "docstring": "Retrieve a single parent by ID.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nReturns\n-------\nParent\n The requested parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_parent", + "signature": "", + "docstring": "Update an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\npayload : ParentCreate\n Updated parent data.\n\nReturns\n-------\nParent\n The updated parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_parent", + "signature": "", + "docstring": "Delete an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_vets", + "signature": "", + "docstring": "List vets (paginated)." + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_vet", + "signature": "", + "docstring": "Create a vet." + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_vet", + "signature": "", + "docstring": "Retrieve a single vet by ID." + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_vet", + "signature": "", + "docstring": "Update an existing vet." + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_vet", + "signature": "", + "docstring": "Delete an existing vet." + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_treatments", + "signature": "", + "docstring": "List treatments (catalogue).\n\nReturns\n-------\nlist[Treatment]\n A list of treatment domain objects." + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_treatment", + "signature": "", + "docstring": "Add a treatment (admin only)." + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_treatment", + "signature": "", + "docstring": "Retrieve a single treatment by ID." + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_treatment", + "signature": "", + "docstring": "Update an existing treatment." + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_treatment", + "signature": "", + "docstring": "Delete an existing treatment." + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_pets", + "signature": "", + "docstring": "List pets (paginated)." + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_pet", + "signature": "", + "docstring": "Create a pet." + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_pet", + "signature": "", + "docstring": "Retrieve a single pet by ID." + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_pet", + "signature": "", + "docstring": "Update an existing pet." + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_pet", + "signature": "", + "docstring": "Delete an existing pet." + }, + "upload_pet_photo": { + "name": "upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.upload_pet_photo", + "signature": "", + "docstring": "Upload a pet photo.\n\nParameters\n----------\nid : int\n Identifier of the pet.\nfile : UploadFile\n Image file to upload.\n\nReturns\n-------\ndict\n A confirmation with the pet ID." + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_appointments", + "signature": "", + "docstring": "List appointments (paginated, filterable)." + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_appointment", + "signature": "", + "docstring": "Create an appointment." + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_appointment", + "signature": "", + "docstring": "Retrieve a single appointment by ID." + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_appointment", + "signature": "", + "docstring": "Update an existing appointment." + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_appointment", + "signature": "", + "docstring": "Delete an existing appointment." + }, + "stream_actions": { + "name": "stream_actions", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.stream_actions", + "signature": "", + "docstring": "Stream animal actions via SSE, scoped to a pet's species." + } + } + }, + "sse": { + "name": "sse", + "kind": "module", + "path": "openapi_first.templates.vet_app.sse", + "signature": null, + "docstring": null, + "members": { + "asyncio": { + "name": "asyncio", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.asyncio", + "signature": "", + "docstring": null + }, + "random": { + "name": "random", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.random", + "signature": "", + "docstring": null + }, + "json": { + "name": "json", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.json", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.unsubscribe", + "signature": "", + "docstring": null + } + } + }, + "test_vet_app": { + "name": "test_vet_app", + "kind": "module", + "path": "openapi_first.templates.vet_app.test_vet_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first Veterinary Clinic example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "test_client": { + "name": "test_client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.test_client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.spec", + "signature": null, + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.client", + "signature": null, + "docstring": null + }, + "test_list_parents": { + "name": "test_list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_parents", + "signature": "", + "docstring": "List parents returns paginated response." + }, + "test_create_parent": { + "name": "test_create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_parent", + "signature": "", + "docstring": "Creating a parent returns 201 with the created entity." + }, + "test_get_parent": { + "name": "test_get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_get_parent", + "signature": "", + "docstring": "Get parent by ID returns the entity." + }, + "test_update_parent": { + "name": "test_update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_update_parent", + "signature": "", + "docstring": "Update parent replaces its values." + }, + "test_delete_parent": { + "name": "test_delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_delete_parent", + "signature": "", + "docstring": "Delete parent returns 204 and removes the entity." + }, + "test_list_vets": { + "name": "test_list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_vets", + "signature": "", + "docstring": "List vets returns paginated response." + }, + "test_create_vet": { + "name": "test_create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_vet", + "signature": "", + "docstring": "Creating a vet returns 201." + }, + "test_list_treatments": { + "name": "test_list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_treatments", + "signature": "", + "docstring": "List treatments returns an array." + }, + "test_create_treatment": { + "name": "test_create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_treatment", + "signature": "", + "docstring": "Creating a treatment returns 201." + }, + "test_create_pet": { + "name": "test_create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_pet", + "signature": "", + "docstring": "Creating a pet links FK references." + }, + "test_upload_pet_photo": { + "name": "test_upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_upload_pet_photo", + "signature": "", + "docstring": "Upload pet photo returns 200." + }, + "test_list_appointments": { + "name": "test_list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_appointments", + "signature": "", + "docstring": "List appointments returns paginated response with filter params." + }, + "test_full_appointment_lifecycle": { + "name": "test_full_appointment_lifecycle", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_full_appointment_lifecycle", + "signature": "", + "docstring": "Create a parent, vet, treatment, pet, then an appointment." + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.templates.model_app.data.json b/docs/mcp/modules/openapi_first.templates.model_app.data.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.model_app.data.json rename to docs/mcp/modules/openapi_first.templates.model_app.data.json diff --git a/mcp_docs/modules/openapi_first.templates.model_app.json b/docs/mcp/modules/openapi_first.templates.model_app.json similarity index 97% rename from mcp_docs/modules/openapi_first.templates.model_app.json rename to docs/mcp/modules/openapi_first.templates.model_app.json index 5cb4841..156663b 100644 --- a/mcp_docs/modules/openapi_first.templates.model_app.json +++ b/docs/mcp/modules/openapi_first.templates.model_app.json @@ -81,7 +81,7 @@ "kind": "class", "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp", "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.templates.model_app.main.json b/docs/mcp/modules/openapi_first.templates.model_app.main.json similarity index 79% rename from mcp_docs/modules/openapi_first.templates.model_app.main.json rename to docs/mcp/modules/openapi_first.templates.model_app.main.json index cac80c3..0c438db 100644 --- a/mcp_docs/modules/openapi_first.templates.model_app.main.json +++ b/docs/mcp/modules/openapi_first.templates.model_app.main.json @@ -9,7 +9,7 @@ "kind": "class", "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp", "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", "members": { "openapi": { "name": "openapi", diff --git a/mcp_docs/modules/openapi_first.templates.model_app.models.json b/docs/mcp/modules/openapi_first.templates.model_app.models.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.model_app.models.json rename to docs/mcp/modules/openapi_first.templates.model_app.models.json diff --git a/mcp_docs/modules/openapi_first.templates.model_app.routes.json b/docs/mcp/modules/openapi_first.templates.model_app.routes.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.model_app.routes.json rename to docs/mcp/modules/openapi_first.templates.model_app.routes.json diff --git a/mcp_docs/modules/openapi_first.templates.model_app.test_model_app.json b/docs/mcp/modules/openapi_first.templates.model_app.test_model_app.json similarity index 100% rename from mcp_docs/modules/openapi_first.templates.model_app.test_model_app.json rename to docs/mcp/modules/openapi_first.templates.model_app.test_model_app.json diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.data.json b/docs/mcp/modules/openapi_first.templates.vet_app.data.json new file mode 100644 index 0000000..bc4563b --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.data.json @@ -0,0 +1,324 @@ +{ + "module": "openapi_first.templates.vet_app.data", + "content": { + "path": "openapi_first.templates.vet_app.data", + "docstring": "In-memory data store for the Veterinary Clinic example.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\n\nIt provides minimal, process-local data stores for the five veterinary\nclinic entities. Each store exposes standard CRUD operations backed by\na simple dictionary.\n\nThis module intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nThis module is not part of the ``openapi_first`` library API surface.", + "objects": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.datetime", + "signature": "", + "docstring": null + }, + "timezone": { + "name": "timezone", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.timezone", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Parent", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.ParentCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Vet", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VetCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Treatment", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Procedure", + "signature": "", + "docstring": null + }, + "BasicNote": { + "name": "BasicNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.BasicNote", + "signature": "", + "docstring": null + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.HeartRateNote", + "signature": "", + "docstring": null + }, + "DentalNote": { + "name": "DentalNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.DentalNote", + "signature": "", + "docstring": null + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VaccineNote", + "signature": "", + "docstring": null + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PreOpNote", + "signature": "", + "docstring": null + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.SurgeryNote", + "signature": "", + "docstring": null + }, + "Pet": { + "name": "Pet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Pet", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PetCreate", + "signature": "", + "docstring": null + }, + "Appointment": { + "name": "Appointment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Appointment", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_parents", + "signature": "", + "docstring": null + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_parent", + "signature": "", + "docstring": null + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_parent", + "signature": "", + "docstring": null + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_parent", + "signature": "", + "docstring": null + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_parent", + "signature": "", + "docstring": null + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_vets", + "signature": "", + "docstring": null + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_vet", + "signature": "", + "docstring": null + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_vet", + "signature": "", + "docstring": null + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_vet", + "signature": "", + "docstring": null + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_vet", + "signature": "", + "docstring": null + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_treatments", + "signature": "", + "docstring": null + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_treatment", + "signature": "", + "docstring": null + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_treatment", + "signature": "", + "docstring": null + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_treatment", + "signature": "", + "docstring": null + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_treatment", + "signature": "", + "docstring": null + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_pets", + "signature": "", + "docstring": null + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_pet", + "signature": "", + "docstring": null + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_pet", + "signature": "", + "docstring": null + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_pet", + "signature": "", + "docstring": null + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_pet", + "signature": "", + "docstring": null + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_appointments", + "signature": "", + "docstring": null + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_appointment", + "signature": "", + "docstring": null + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_appointment", + "signature": "", + "docstring": null + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_appointment", + "signature": "", + "docstring": null + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_appointment", + "signature": "", + "docstring": null + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.json b/docs/mcp/modules/openapi_first.templates.vet_app.json new file mode 100644 index 0000000..656100e --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.json @@ -0,0 +1,1572 @@ +{ + "module": "openapi_first.templates.vet_app", + "content": { + "path": "openapi_first.templates.vet_app", + "docstring": "OpenAPI-first Veterinary Clinic application template.\n\nThis package contains a complete, runnable example of an OpenAPI-first\nveterinary clinic management service. It demonstrates all ``x-`` extension\nfields consumed by the ``react-openapi`` admin panel renderer.\n\nThe application manages five resources:\n\n- **Parents** — pet owners with contact details\n- **Vets** — veterinarians with specializations\n- **Treatments** — medical procedure catalog\n- **Pets** — animals with species, age, weight, and photos\n- **Appointments** — scheduled visits linking pets, vets, and treatments\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification (``openapi.yaml``). Every operation has an\nexplicit ``operationId`` that maps to a Python handler in ``routes.py``.\n\nThis file is a copyable template. It is not part of the ``openapi_first``\nlibrary API surface.\n\n----------------------------------------------------------------------\nOpenAPI x- extension fields demonstrated\n----------------------------------------------------------------------\n\nSchema-level extensions (display metadata for resource endpoints):\n\n ``x-primary-key`` (REQUIRED) Primary key property name\n ``x-display-format`` (REQUIRED) Human-readable label template\n ``x-list-columns`` (REQUIRED) Columns for the datatable\n\nProperty-level extensions (control UI rendering):\n\n ``x-label`` (REQUIRED) Human-readable field label\n ``x-order`` (REQUIRED) Field ordering in forms/detail\n ``x-description`` (optional) Helper text below form fields\n ``x-hidden`` (optional) Visibility in form / list / detail\n ``x-filterable`` (optional) Allows column filtering\n ``x-sortable`` (optional) Allows column sorting\n ``x-fk`` (optional) Foreign key — renders as dropdown\n ``x-fk.resource`` (REQUIRED for FK) Target resource name\n ``x-fk.prefetch`` (optional) Preload all FK options on mount\n ``x-ui-type`` (optional) Custom UI type (e.g. image upload)\n ``x-upload-url`` (optional) Upload endpoint for binary fields\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new vet clinic service using the bundled template:\n\n openapi-first vet_app\n\nCreate the service in a custom directory:\n\n openapi-first vet_app my-vet-clinic\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List pets with pagination\n response = client.list_pets(query_params={\"limit\": 10, \"offset\": 0})\n\n # Create a pet with FK references\n response = client.create_pet(\n body={\"name\": \"Fido\", \"species\": \"dog\", \"parents\": [1, 2]}\n )\n\n # Upload a pet photo\n response = client.upload_pet_photo(\n path_params={\"id\": 1},\n body={\"file\": open(\"photo.jpg\", \"rb\")},\n )\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", + "objects": { + "data": { + "name": "data", + "kind": "module", + "path": "openapi_first.templates.vet_app.data", + "signature": null, + "docstring": "In-memory data store for the Veterinary Clinic example.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\n\nIt provides minimal, process-local data stores for the five veterinary\nclinic entities. Each store exposes standard CRUD operations backed by\na simple dictionary.\n\nThis module intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nThis module is not part of the ``openapi_first`` library API surface.", + "members": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.datetime", + "signature": "", + "docstring": null + }, + "timezone": { + "name": "timezone", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.timezone", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Parent", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.ParentCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Vet", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VetCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Treatment", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Procedure", + "signature": "", + "docstring": null + }, + "BasicNote": { + "name": "BasicNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.BasicNote", + "signature": "", + "docstring": null + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.HeartRateNote", + "signature": "", + "docstring": null + }, + "DentalNote": { + "name": "DentalNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.DentalNote", + "signature": "", + "docstring": null + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.VaccineNote", + "signature": "", + "docstring": null + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PreOpNote", + "signature": "", + "docstring": null + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.SurgeryNote", + "signature": "", + "docstring": null + }, + "Pet": { + "name": "Pet", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Pet", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.PetCreate", + "signature": "", + "docstring": null + }, + "Appointment": { + "name": "Appointment", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.Appointment", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.data.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_parents", + "signature": "", + "docstring": null + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_parent", + "signature": "", + "docstring": null + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_parent", + "signature": "", + "docstring": null + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_parent", + "signature": "", + "docstring": null + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_parent", + "signature": "", + "docstring": null + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_vets", + "signature": "", + "docstring": null + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_vet", + "signature": "", + "docstring": null + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_vet", + "signature": "", + "docstring": null + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_vet", + "signature": "", + "docstring": null + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_vet", + "signature": "", + "docstring": null + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_treatments", + "signature": "", + "docstring": null + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_treatment", + "signature": "", + "docstring": null + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_treatment", + "signature": "", + "docstring": null + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_treatment", + "signature": "", + "docstring": null + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_treatment", + "signature": "", + "docstring": null + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_pets", + "signature": "", + "docstring": null + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_pet", + "signature": "", + "docstring": null + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_pet", + "signature": "", + "docstring": null + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_pet", + "signature": "", + "docstring": null + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_pet", + "signature": "", + "docstring": null + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.list_appointments", + "signature": "", + "docstring": null + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.get_appointment", + "signature": "", + "docstring": null + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.create_appointment", + "signature": "", + "docstring": null + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.update_appointment", + "signature": "", + "docstring": null + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.data.delete_appointment", + "signature": "", + "docstring": null + } + } + }, + "main": { + "name": "main", + "kind": "module", + "path": "openapi_first.templates.vet_app.main", + "signature": null, + "docstring": "Application entry point for an OpenAPI-first Veterinary Clinic service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "members": { + "asynccontextmanager": { + "name": "asynccontextmanager", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.asynccontextmanager", + "signature": "", + "docstring": null + }, + "CORSMiddleware": { + "name": "CORSMiddleware", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.CORSMiddleware", + "signature": "", + "docstring": null + }, + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.routes", + "signature": "", + "docstring": null + }, + "lifespan": { + "name": "lifespan", + "kind": "function", + "path": "openapi_first.templates.vet_app.main.lifespan", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.app", + "signature": null, + "docstring": null + } + } + }, + "models": { + "name": "models", + "kind": "module", + "path": "openapi_first.templates.vet_app.models", + "signature": null, + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.datetime", + "signature": "", + "docstring": null + }, + "Annotated": { + "name": "Annotated", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Annotated", + "signature": "", + "docstring": null + }, + "Literal": { + "name": "Literal", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Literal", + "signature": "", + "docstring": null + }, + "BaseModel": { + "name": "BaseModel", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.BaseModel", + "signature": "", + "docstring": null + }, + "Field": { + "name": "Field", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Field", + "signature": "", + "docstring": null + }, + "Metadata": { + "name": "Metadata", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Metadata", + "signature": "", + "docstring": null, + "members": { + "createdOn": { + "name": "createdOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.createdOn", + "signature": null, + "docstring": null + }, + "updatedOn": { + "name": "updatedOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.updatedOn", + "signature": null, + "docstring": null + } + } + }, + "ParentBase": { + "name": "ParentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.name", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentCreate", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Parent", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Parent.id", + "signature": null, + "docstring": null + } + } + }, + "VetBase": { + "name": "VetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.name", + "signature": null, + "docstring": null + }, + "specialty": { + "name": "specialty", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.specialty", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "VetCreate": { + "name": "VetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Vet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Vet.id", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNoteBase": { + "name": "ProcedureNoteBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase", + "signature": "", + "docstring": null, + "members": { + "summary": { + "name": "summary", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.summary", + "signature": null, + "docstring": null + }, + "details": { + "name": "details", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.details", + "signature": null, + "docstring": null + } + } + }, + "BasicNote": { + "name": "BasicNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.BasicNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.BasicNote.noteType", + "signature": null, + "docstring": null + } + } + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.HeartRateNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.noteType", + "signature": null, + "docstring": null + }, + "bpm": { + "name": "bpm", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.bpm", + "signature": null, + "docstring": null + } + } + }, + "DentalNote": { + "name": "DentalNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.DentalNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.noteType", + "signature": null, + "docstring": null + }, + "procedureType": { + "name": "procedureType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.procedureType", + "signature": null, + "docstring": null + }, + "teeth": { + "name": "teeth", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.teeth", + "signature": null, + "docstring": null + } + } + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VaccineNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.noteType", + "signature": null, + "docstring": null + }, + "medicine": { + "name": "medicine", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.medicine", + "signature": null, + "docstring": null + }, + "leg": { + "name": "leg", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.leg", + "signature": null, + "docstring": null + } + } + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PreOpNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.noteType", + "signature": null, + "docstring": null + }, + "heartRate": { + "name": "heartRate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.heartRate", + "signature": null, + "docstring": null + }, + "temperature": { + "name": "temperature", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.temperature", + "signature": null, + "docstring": null + } + } + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.SurgeryNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.noteType", + "signature": null, + "docstring": null + }, + "surgeryType": { + "name": "surgeryType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.surgeryType", + "signature": null, + "docstring": null + }, + "complications": { + "name": "complications", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.complications", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNotes": { + "name": "ProcedureNotes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNotes", + "signature": null, + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Procedure", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.name", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.description", + "signature": null, + "docstring": null + }, + "cost": { + "name": "cost", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.cost", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.notes", + "signature": null, + "docstring": null + } + } + }, + "TreatmentBase": { + "name": "TreatmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentBase", + "signature": "", + "docstring": null, + "members": { + "label": { + "name": "label", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.label", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.description", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Treatment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Treatment.id", + "signature": null, + "docstring": null + } + } + }, + "PetBase": { + "name": "PetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.name", + "signature": null, + "docstring": null + }, + "species": { + "name": "species", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.species", + "signature": null, + "docstring": null + }, + "age": { + "name": "age", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.age", + "signature": null, + "docstring": null + }, + "weight": { + "name": "weight", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.weight", + "signature": null, + "docstring": null + }, + "birthDate": { + "name": "birthDate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.birthDate", + "signature": null, + "docstring": null + }, + "photo": { + "name": "photo", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.photo", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "PetCreate": { + "name": "PetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetCreate", + "signature": "", + "docstring": null, + "members": { + "parent_ids": { + "name": "parent_ids", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetCreate.parent_ids", + "signature": null, + "docstring": null + } + } + }, + "Pet": { + "name": "Pet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Pet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.id", + "signature": null, + "docstring": null + }, + "parents": { + "name": "parents", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.parents", + "signature": null, + "docstring": null + } + } + }, + "AppointmentBase": { + "name": "AppointmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentBase", + "signature": "", + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.date", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.notes", + "signature": null, + "docstring": null + }, + "procedures": { + "name": "procedures", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.procedures", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate", + "signature": "", + "docstring": null, + "members": { + "pet_id": { + "name": "pet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.pet_id", + "signature": null, + "docstring": null + }, + "vet_id": { + "name": "vet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.vet_id", + "signature": null, + "docstring": null + }, + "treatment_id": { + "name": "treatment_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.treatment_id", + "signature": null, + "docstring": null + } + } + }, + "Appointment": { + "name": "Appointment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Appointment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.id", + "signature": null, + "docstring": null + }, + "pet": { + "name": "pet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.pet", + "signature": null, + "docstring": null + }, + "vet": { + "name": "vet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.vet", + "signature": null, + "docstring": null + }, + "treatment": { + "name": "treatment", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.treatment", + "signature": null, + "docstring": null + } + } + } + } + }, + "routes": { + "name": "routes", + "kind": "module", + "path": "openapi_first.templates.vet_app.routes", + "signature": null, + "docstring": "Veterinary Clinic route handlers bound via OpenAPI operationId.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", + "members": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "UploadFile": { + "name": "UploadFile", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.UploadFile", + "signature": "", + "docstring": null + }, + "StreamingResponse": { + "name": "StreamingResponse", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.StreamingResponse", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.unsubscribe", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.ParentCreate", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.VetCreate", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.TreatmentCreate", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.PetCreate", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_parents", + "signature": "", + "docstring": "List parents (paginated).\n\nParameters\n----------\nlimit : int\n Maximum number of records to return.\noffset : int\n Number of records to skip.\n\nReturns\n-------\ndict\n Paginated response with ``total`` and ``items``." + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_parent", + "signature": "", + "docstring": "Create a parent.\n\nParameters\n----------\npayload : ParentCreate\n Parent data excluding the ``id`` field.\n\nReturns\n-------\nParent\n The newly created parent." + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_parent", + "signature": "", + "docstring": "Retrieve a single parent by ID.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nReturns\n-------\nParent\n The requested parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_parent", + "signature": "", + "docstring": "Update an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\npayload : ParentCreate\n Updated parent data.\n\nReturns\n-------\nParent\n The updated parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_parent", + "signature": "", + "docstring": "Delete an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_vets", + "signature": "", + "docstring": "List vets (paginated)." + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_vet", + "signature": "", + "docstring": "Create a vet." + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_vet", + "signature": "", + "docstring": "Retrieve a single vet by ID." + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_vet", + "signature": "", + "docstring": "Update an existing vet." + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_vet", + "signature": "", + "docstring": "Delete an existing vet." + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_treatments", + "signature": "", + "docstring": "List treatments (catalogue).\n\nReturns\n-------\nlist[Treatment]\n A list of treatment domain objects." + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_treatment", + "signature": "", + "docstring": "Add a treatment (admin only)." + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_treatment", + "signature": "", + "docstring": "Retrieve a single treatment by ID." + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_treatment", + "signature": "", + "docstring": "Update an existing treatment." + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_treatment", + "signature": "", + "docstring": "Delete an existing treatment." + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_pets", + "signature": "", + "docstring": "List pets (paginated)." + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_pet", + "signature": "", + "docstring": "Create a pet." + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_pet", + "signature": "", + "docstring": "Retrieve a single pet by ID." + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_pet", + "signature": "", + "docstring": "Update an existing pet." + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_pet", + "signature": "", + "docstring": "Delete an existing pet." + }, + "upload_pet_photo": { + "name": "upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.upload_pet_photo", + "signature": "", + "docstring": "Upload a pet photo.\n\nParameters\n----------\nid : int\n Identifier of the pet.\nfile : UploadFile\n Image file to upload.\n\nReturns\n-------\ndict\n A confirmation with the pet ID." + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_appointments", + "signature": "", + "docstring": "List appointments (paginated, filterable)." + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_appointment", + "signature": "", + "docstring": "Create an appointment." + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_appointment", + "signature": "", + "docstring": "Retrieve a single appointment by ID." + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_appointment", + "signature": "", + "docstring": "Update an existing appointment." + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_appointment", + "signature": "", + "docstring": "Delete an existing appointment." + }, + "stream_actions": { + "name": "stream_actions", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.stream_actions", + "signature": "", + "docstring": "Stream animal actions via SSE, scoped to a pet's species." + } + } + }, + "sse": { + "name": "sse", + "kind": "module", + "path": "openapi_first.templates.vet_app.sse", + "signature": null, + "docstring": null, + "members": { + "asyncio": { + "name": "asyncio", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.asyncio", + "signature": "", + "docstring": null + }, + "random": { + "name": "random", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.random", + "signature": "", + "docstring": null + }, + "json": { + "name": "json", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.json", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.unsubscribe", + "signature": "", + "docstring": null + } + } + }, + "test_vet_app": { + "name": "test_vet_app", + "kind": "module", + "path": "openapi_first.templates.vet_app.test_vet_app", + "signature": null, + "docstring": "End-to-end tests for the OpenAPI-first Veterinary Clinic example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.", + "members": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "test_client": { + "name": "test_client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.test_client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.spec", + "signature": null, + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.client", + "signature": null, + "docstring": null + }, + "test_list_parents": { + "name": "test_list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_parents", + "signature": "", + "docstring": "List parents returns paginated response." + }, + "test_create_parent": { + "name": "test_create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_parent", + "signature": "", + "docstring": "Creating a parent returns 201 with the created entity." + }, + "test_get_parent": { + "name": "test_get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_get_parent", + "signature": "", + "docstring": "Get parent by ID returns the entity." + }, + "test_update_parent": { + "name": "test_update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_update_parent", + "signature": "", + "docstring": "Update parent replaces its values." + }, + "test_delete_parent": { + "name": "test_delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_delete_parent", + "signature": "", + "docstring": "Delete parent returns 204 and removes the entity." + }, + "test_list_vets": { + "name": "test_list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_vets", + "signature": "", + "docstring": "List vets returns paginated response." + }, + "test_create_vet": { + "name": "test_create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_vet", + "signature": "", + "docstring": "Creating a vet returns 201." + }, + "test_list_treatments": { + "name": "test_list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_treatments", + "signature": "", + "docstring": "List treatments returns an array." + }, + "test_create_treatment": { + "name": "test_create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_treatment", + "signature": "", + "docstring": "Creating a treatment returns 201." + }, + "test_create_pet": { + "name": "test_create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_pet", + "signature": "", + "docstring": "Creating a pet links FK references." + }, + "test_upload_pet_photo": { + "name": "test_upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_upload_pet_photo", + "signature": "", + "docstring": "Upload pet photo returns 200." + }, + "test_list_appointments": { + "name": "test_list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_appointments", + "signature": "", + "docstring": "List appointments returns paginated response with filter params." + }, + "test_full_appointment_lifecycle": { + "name": "test_full_appointment_lifecycle", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_full_appointment_lifecycle", + "signature": "", + "docstring": "Create a parent, vet, treatment, pet, then an appointment." + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.main.json b/docs/mcp/modules/openapi_first.templates.vet_app.main.json new file mode 100644 index 0000000..6d5af0f --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.main.json @@ -0,0 +1,60 @@ +{ + "module": "openapi_first.templates.vet_app.main", + "content": { + "path": "openapi_first.templates.vet_app.main", + "docstring": "Application entry point for an OpenAPI-first Veterinary Clinic service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", + "objects": { + "asynccontextmanager": { + "name": "asynccontextmanager", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.asynccontextmanager", + "signature": "", + "docstring": null + }, + "CORSMiddleware": { + "name": "CORSMiddleware", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.CORSMiddleware", + "signature": "", + "docstring": null + }, + "OpenAPIFirstApp": { + "name": "OpenAPIFirstApp", + "kind": "class", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp", + "signature": "", + "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each ``operationId`` is mapped to a Python function in the\n supplied routes module.\n - Auth dependencies are auto-injected from the spec's\n ``securitySchemes`` and per-operation ``security`` fields.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and ``/openapi.json`` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n - Auth enforcement is driven entirely by the spec — no manual\n middleware or decorators required.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", + "members": { + "openapi": { + "name": "openapi", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.OpenAPIFirstApp.openapi", + "signature": "", + "docstring": null + } + } + }, + "routes": { + "name": "routes", + "kind": "alias", + "path": "openapi_first.templates.vet_app.main.routes", + "signature": "", + "docstring": null + }, + "lifespan": { + "name": "lifespan", + "kind": "function", + "path": "openapi_first.templates.vet_app.main.lifespan", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.main.app", + "signature": null, + "docstring": null + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.models.json b/docs/mcp/modules/openapi_first.templates.vet_app.models.json new file mode 100644 index 0000000..ecc0e8a --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.models.json @@ -0,0 +1,681 @@ +{ + "module": "openapi_first.templates.vet_app.models", + "content": { + "path": "openapi_first.templates.vet_app.models", + "docstring": null, + "objects": { + "date": { + "name": "date", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.date", + "signature": "", + "docstring": null + }, + "datetime": { + "name": "datetime", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.datetime", + "signature": "", + "docstring": null + }, + "Annotated": { + "name": "Annotated", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Annotated", + "signature": "", + "docstring": null + }, + "Literal": { + "name": "Literal", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Literal", + "signature": "", + "docstring": null + }, + "BaseModel": { + "name": "BaseModel", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.BaseModel", + "signature": "", + "docstring": null + }, + "Field": { + "name": "Field", + "kind": "alias", + "path": "openapi_first.templates.vet_app.models.Field", + "signature": "", + "docstring": null + }, + "Metadata": { + "name": "Metadata", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Metadata", + "signature": "", + "docstring": null, + "members": { + "createdOn": { + "name": "createdOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.createdOn", + "signature": null, + "docstring": null + }, + "updatedOn": { + "name": "updatedOn", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Metadata.updatedOn", + "signature": null, + "docstring": null + } + } + }, + "ParentBase": { + "name": "ParentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.name", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ParentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ParentCreate", + "signature": "", + "docstring": null + }, + "Parent": { + "name": "Parent", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Parent", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Parent.id", + "signature": null, + "docstring": null + } + } + }, + "VetBase": { + "name": "VetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.name", + "signature": null, + "docstring": null + }, + "specialty": { + "name": "specialty", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.specialty", + "signature": null, + "docstring": null + }, + "email": { + "name": "email", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.email", + "signature": null, + "docstring": null + }, + "phone": { + "name": "phone", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.phone", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "VetCreate": { + "name": "VetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VetCreate", + "signature": "", + "docstring": null + }, + "Vet": { + "name": "Vet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Vet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Vet.id", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNoteBase": { + "name": "ProcedureNoteBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase", + "signature": "", + "docstring": null, + "members": { + "summary": { + "name": "summary", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.summary", + "signature": null, + "docstring": null + }, + "details": { + "name": "details", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNoteBase.details", + "signature": null, + "docstring": null + } + } + }, + "BasicNote": { + "name": "BasicNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.BasicNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.BasicNote.noteType", + "signature": null, + "docstring": null + } + } + }, + "HeartRateNote": { + "name": "HeartRateNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.HeartRateNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.noteType", + "signature": null, + "docstring": null + }, + "bpm": { + "name": "bpm", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.HeartRateNote.bpm", + "signature": null, + "docstring": null + } + } + }, + "DentalNote": { + "name": "DentalNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.DentalNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.noteType", + "signature": null, + "docstring": null + }, + "procedureType": { + "name": "procedureType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.procedureType", + "signature": null, + "docstring": null + }, + "teeth": { + "name": "teeth", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.DentalNote.teeth", + "signature": null, + "docstring": null + } + } + }, + "VaccineNote": { + "name": "VaccineNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.VaccineNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.noteType", + "signature": null, + "docstring": null + }, + "medicine": { + "name": "medicine", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.medicine", + "signature": null, + "docstring": null + }, + "leg": { + "name": "leg", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.VaccineNote.leg", + "signature": null, + "docstring": null + } + } + }, + "PreOpNote": { + "name": "PreOpNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PreOpNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.noteType", + "signature": null, + "docstring": null + }, + "heartRate": { + "name": "heartRate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.heartRate", + "signature": null, + "docstring": null + }, + "temperature": { + "name": "temperature", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PreOpNote.temperature", + "signature": null, + "docstring": null + } + } + }, + "SurgeryNote": { + "name": "SurgeryNote", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.SurgeryNote", + "signature": "", + "docstring": null, + "members": { + "noteType": { + "name": "noteType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.noteType", + "signature": null, + "docstring": null + }, + "surgeryType": { + "name": "surgeryType", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.surgeryType", + "signature": null, + "docstring": null + }, + "complications": { + "name": "complications", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.SurgeryNote.complications", + "signature": null, + "docstring": null + } + } + }, + "ProcedureNotes": { + "name": "ProcedureNotes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.ProcedureNotes", + "signature": null, + "docstring": null + }, + "Procedure": { + "name": "Procedure", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Procedure", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.name", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.description", + "signature": null, + "docstring": null + }, + "cost": { + "name": "cost", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.cost", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Procedure.notes", + "signature": null, + "docstring": null + } + } + }, + "TreatmentBase": { + "name": "TreatmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentBase", + "signature": "", + "docstring": null, + "members": { + "label": { + "name": "label", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.label", + "signature": null, + "docstring": null + }, + "description": { + "name": "description", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.description", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.TreatmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.TreatmentCreate", + "signature": "", + "docstring": null + }, + "Treatment": { + "name": "Treatment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Treatment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Treatment.id", + "signature": null, + "docstring": null + } + } + }, + "PetBase": { + "name": "PetBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetBase", + "signature": "", + "docstring": null, + "members": { + "name": { + "name": "name", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.name", + "signature": null, + "docstring": null + }, + "species": { + "name": "species", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.species", + "signature": null, + "docstring": null + }, + "age": { + "name": "age", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.age", + "signature": null, + "docstring": null + }, + "weight": { + "name": "weight", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.weight", + "signature": null, + "docstring": null + }, + "birthDate": { + "name": "birthDate", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.birthDate", + "signature": null, + "docstring": null + }, + "photo": { + "name": "photo", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.photo", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "PetCreate": { + "name": "PetCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.PetCreate", + "signature": "", + "docstring": null, + "members": { + "parent_ids": { + "name": "parent_ids", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.PetCreate.parent_ids", + "signature": null, + "docstring": null + } + } + }, + "Pet": { + "name": "Pet", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Pet", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.id", + "signature": null, + "docstring": null + }, + "parents": { + "name": "parents", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Pet.parents", + "signature": null, + "docstring": null + } + } + }, + "AppointmentBase": { + "name": "AppointmentBase", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentBase", + "signature": "", + "docstring": null, + "members": { + "date": { + "name": "date", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.date", + "signature": null, + "docstring": null + }, + "notes": { + "name": "notes", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.notes", + "signature": null, + "docstring": null + }, + "procedures": { + "name": "procedures", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.procedures", + "signature": null, + "docstring": null + }, + "metadata": { + "name": "metadata", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentBase.metadata", + "signature": null, + "docstring": null + } + } + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate", + "signature": "", + "docstring": null, + "members": { + "pet_id": { + "name": "pet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.pet_id", + "signature": null, + "docstring": null + }, + "vet_id": { + "name": "vet_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.vet_id", + "signature": null, + "docstring": null + }, + "treatment_id": { + "name": "treatment_id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.AppointmentCreate.treatment_id", + "signature": null, + "docstring": null + } + } + }, + "Appointment": { + "name": "Appointment", + "kind": "class", + "path": "openapi_first.templates.vet_app.models.Appointment", + "signature": "", + "docstring": null, + "members": { + "id": { + "name": "id", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.id", + "signature": null, + "docstring": null + }, + "pet": { + "name": "pet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.pet", + "signature": null, + "docstring": null + }, + "vet": { + "name": "vet", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.vet", + "signature": null, + "docstring": null + }, + "treatment": { + "name": "treatment", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.models.Appointment.treatment", + "signature": null, + "docstring": null + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.routes.json b/docs/mcp/modules/openapi_first.templates.vet_app.routes.json new file mode 100644 index 0000000..8067f66 --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.routes.json @@ -0,0 +1,275 @@ +{ + "module": "openapi_first.templates.vet_app.routes", + "content": { + "path": "openapi_first.templates.vet_app.routes", + "docstring": "Veterinary Clinic route handlers bound via OpenAPI operationId.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", + "objects": { + "Response": { + "name": "Response", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.Response", + "signature": "", + "docstring": null + }, + "HTTPException": { + "name": "HTTPException", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.HTTPException", + "signature": "", + "docstring": null + }, + "UploadFile": { + "name": "UploadFile", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.UploadFile", + "signature": "", + "docstring": null + }, + "StreamingResponse": { + "name": "StreamingResponse", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.StreamingResponse", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.unsubscribe", + "signature": "", + "docstring": null + }, + "ParentCreate": { + "name": "ParentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.ParentCreate", + "signature": "", + "docstring": null + }, + "VetCreate": { + "name": "VetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.VetCreate", + "signature": "", + "docstring": null + }, + "TreatmentCreate": { + "name": "TreatmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.TreatmentCreate", + "signature": "", + "docstring": null + }, + "PetCreate": { + "name": "PetCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.PetCreate", + "signature": "", + "docstring": null + }, + "AppointmentCreate": { + "name": "AppointmentCreate", + "kind": "alias", + "path": "openapi_first.templates.vet_app.routes.AppointmentCreate", + "signature": "", + "docstring": null + }, + "list_parents": { + "name": "list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_parents", + "signature": "", + "docstring": "List parents (paginated).\n\nParameters\n----------\nlimit : int\n Maximum number of records to return.\noffset : int\n Number of records to skip.\n\nReturns\n-------\ndict\n Paginated response with ``total`` and ``items``." + }, + "create_parent": { + "name": "create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_parent", + "signature": "", + "docstring": "Create a parent.\n\nParameters\n----------\npayload : ParentCreate\n Parent data excluding the ``id`` field.\n\nReturns\n-------\nParent\n The newly created parent." + }, + "get_parent": { + "name": "get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_parent", + "signature": "", + "docstring": "Retrieve a single parent by ID.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nReturns\n-------\nParent\n The requested parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "update_parent": { + "name": "update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_parent", + "signature": "", + "docstring": "Update an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\npayload : ParentCreate\n Updated parent data.\n\nReturns\n-------\nParent\n The updated parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "delete_parent": { + "name": "delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_parent", + "signature": "", + "docstring": "Delete an existing parent.\n\nParameters\n----------\nid : int\n Identifier of the parent.\n\nRaises\n------\nHTTPException\n 404 if the parent does not exist." + }, + "list_vets": { + "name": "list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_vets", + "signature": "", + "docstring": "List vets (paginated)." + }, + "create_vet": { + "name": "create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_vet", + "signature": "", + "docstring": "Create a vet." + }, + "get_vet": { + "name": "get_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_vet", + "signature": "", + "docstring": "Retrieve a single vet by ID." + }, + "update_vet": { + "name": "update_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_vet", + "signature": "", + "docstring": "Update an existing vet." + }, + "delete_vet": { + "name": "delete_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_vet", + "signature": "", + "docstring": "Delete an existing vet." + }, + "list_treatments": { + "name": "list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_treatments", + "signature": "", + "docstring": "List treatments (catalogue).\n\nReturns\n-------\nlist[Treatment]\n A list of treatment domain objects." + }, + "create_treatment": { + "name": "create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_treatment", + "signature": "", + "docstring": "Add a treatment (admin only)." + }, + "get_treatment": { + "name": "get_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_treatment", + "signature": "", + "docstring": "Retrieve a single treatment by ID." + }, + "update_treatment": { + "name": "update_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_treatment", + "signature": "", + "docstring": "Update an existing treatment." + }, + "delete_treatment": { + "name": "delete_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_treatment", + "signature": "", + "docstring": "Delete an existing treatment." + }, + "list_pets": { + "name": "list_pets", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_pets", + "signature": "", + "docstring": "List pets (paginated)." + }, + "create_pet": { + "name": "create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_pet", + "signature": "", + "docstring": "Create a pet." + }, + "get_pet": { + "name": "get_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_pet", + "signature": "", + "docstring": "Retrieve a single pet by ID." + }, + "update_pet": { + "name": "update_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_pet", + "signature": "", + "docstring": "Update an existing pet." + }, + "delete_pet": { + "name": "delete_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_pet", + "signature": "", + "docstring": "Delete an existing pet." + }, + "upload_pet_photo": { + "name": "upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.upload_pet_photo", + "signature": "", + "docstring": "Upload a pet photo.\n\nParameters\n----------\nid : int\n Identifier of the pet.\nfile : UploadFile\n Image file to upload.\n\nReturns\n-------\ndict\n A confirmation with the pet ID." + }, + "list_appointments": { + "name": "list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.list_appointments", + "signature": "", + "docstring": "List appointments (paginated, filterable)." + }, + "create_appointment": { + "name": "create_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.create_appointment", + "signature": "", + "docstring": "Create an appointment." + }, + "get_appointment": { + "name": "get_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.get_appointment", + "signature": "", + "docstring": "Retrieve a single appointment by ID." + }, + "update_appointment": { + "name": "update_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.update_appointment", + "signature": "", + "docstring": "Update an existing appointment." + }, + "delete_appointment": { + "name": "delete_appointment", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.delete_appointment", + "signature": "", + "docstring": "Delete an existing appointment." + }, + "stream_actions": { + "name": "stream_actions", + "kind": "function", + "path": "openapi_first.templates.vet_app.routes.stream_actions", + "signature": "", + "docstring": "Stream animal actions via SSE, scoped to a pet's species." + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.sse.json b/docs/mcp/modules/openapi_first.templates.vet_app.sse.json new file mode 100644 index 0000000..8d41190 --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.sse.json @@ -0,0 +1,44 @@ +{ + "module": "openapi_first.templates.vet_app.sse", + "content": { + "path": "openapi_first.templates.vet_app.sse", + "docstring": null, + "objects": { + "asyncio": { + "name": "asyncio", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.asyncio", + "signature": "", + "docstring": null + }, + "random": { + "name": "random", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.random", + "signature": "", + "docstring": null + }, + "json": { + "name": "json", + "kind": "alias", + "path": "openapi_first.templates.vet_app.sse.json", + "signature": "", + "docstring": null + }, + "subscribe": { + "name": "subscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.subscribe", + "signature": "", + "docstring": null + }, + "unsubscribe": { + "name": "unsubscribe", + "kind": "function", + "path": "openapi_first.templates.vet_app.sse.unsubscribe", + "signature": "", + "docstring": null + } + } + } +} \ No newline at end of file diff --git a/docs/mcp/modules/openapi_first.templates.vet_app.test_vet_app.json b/docs/mcp/modules/openapi_first.templates.vet_app.test_vet_app.json new file mode 100644 index 0000000..54da939 --- /dev/null +++ b/docs/mcp/modules/openapi_first.templates.vet_app.test_vet_app.json @@ -0,0 +1,179 @@ +{ + "module": "openapi_first.templates.vet_app.test_vet_app", + "content": { + "path": "openapi_first.templates.vet_app.test_vet_app", + "docstring": "End-to-end tests for the OpenAPI-first Veterinary Clinic example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.", + "objects": { + "TestClient": { + "name": "TestClient", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.TestClient", + "signature": "", + "docstring": null + }, + "app": { + "name": "app", + "kind": "alias", + "path": "openapi_first.templates.vet_app.test_vet_app.app", + "signature": "", + "docstring": null + }, + "load_openapi": { + "name": "load_openapi", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.load_openapi", + "signature": "", + "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." + }, + "OpenAPIClient": { + "name": "OpenAPIClient", + "kind": "class", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient", + "signature": "", + "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", + "members": { + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.spec", + "signature": "", + "docstring": null + }, + "base_url": { + "name": "base_url", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.base_url", + "signature": "", + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.client", + "signature": "", + "docstring": null + }, + "operations": { + "name": "operations", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.OpenAPIClient.operations", + "signature": "", + "docstring": null + } + } + }, + "test_client": { + "name": "test_client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.test_client", + "signature": null, + "docstring": null + }, + "spec": { + "name": "spec", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.spec", + "signature": null, + "docstring": null + }, + "client": { + "name": "client", + "kind": "attribute", + "path": "openapi_first.templates.vet_app.test_vet_app.client", + "signature": null, + "docstring": null + }, + "test_list_parents": { + "name": "test_list_parents", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_parents", + "signature": "", + "docstring": "List parents returns paginated response." + }, + "test_create_parent": { + "name": "test_create_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_parent", + "signature": "", + "docstring": "Creating a parent returns 201 with the created entity." + }, + "test_get_parent": { + "name": "test_get_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_get_parent", + "signature": "", + "docstring": "Get parent by ID returns the entity." + }, + "test_update_parent": { + "name": "test_update_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_update_parent", + "signature": "", + "docstring": "Update parent replaces its values." + }, + "test_delete_parent": { + "name": "test_delete_parent", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_delete_parent", + "signature": "", + "docstring": "Delete parent returns 204 and removes the entity." + }, + "test_list_vets": { + "name": "test_list_vets", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_vets", + "signature": "", + "docstring": "List vets returns paginated response." + }, + "test_create_vet": { + "name": "test_create_vet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_vet", + "signature": "", + "docstring": "Creating a vet returns 201." + }, + "test_list_treatments": { + "name": "test_list_treatments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_treatments", + "signature": "", + "docstring": "List treatments returns an array." + }, + "test_create_treatment": { + "name": "test_create_treatment", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_treatment", + "signature": "", + "docstring": "Creating a treatment returns 201." + }, + "test_create_pet": { + "name": "test_create_pet", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_create_pet", + "signature": "", + "docstring": "Creating a pet links FK references." + }, + "test_upload_pet_photo": { + "name": "test_upload_pet_photo", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_upload_pet_photo", + "signature": "", + "docstring": "Upload pet photo returns 200." + }, + "test_list_appointments": { + "name": "test_list_appointments", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_list_appointments", + "signature": "", + "docstring": "List appointments returns paginated response with filter params." + }, + "test_full_appointment_lifecycle": { + "name": "test_full_appointment_lifecycle", + "kind": "function", + "path": "openapi_first.templates.vet_app.test_vet_app.test_full_appointment_lifecycle", + "signature": "", + "docstring": "Create a parent, vet, treatment, pet, then an appointment." + } + } + } +} \ No newline at end of file diff --git a/mcp_docs/nav.json b/docs/mcp/nav.json similarity index 68% rename from mcp_docs/nav.json rename to docs/mcp/nav.json index d56465a..0299586 100644 --- a/mcp_docs/nav.json +++ b/docs/mcp/nav.json @@ -19,6 +19,14 @@ "module": "openapi_first.client", "resource": "doc://modules/openapi_first.client" }, + { + "module": "openapi_first.codegen", + "resource": "doc://modules/openapi_first.codegen" + }, + { + "module": "openapi_first.codegen_routes", + "resource": "doc://modules/openapi_first.codegen_routes" + }, { "module": "openapi_first.errors", "resource": "doc://modules/openapi_first.errors" @@ -27,6 +35,10 @@ "module": "openapi_first.loader", "resource": "doc://modules/openapi_first.loader" }, + { + "module": "openapi_first.security", + "resource": "doc://modules/openapi_first.security" + }, { "module": "openapi_first.templates", "resource": "doc://modules/openapi_first.templates" @@ -86,5 +98,33 @@ { "module": "openapi_first.templates.model_app.test_model_app", "resource": "doc://modules/openapi_first.templates.model_app.test_model_app" + }, + { + "module": "openapi_first.templates.vet_app", + "resource": "doc://modules/openapi_first.templates.vet_app" + }, + { + "module": "openapi_first.templates.vet_app.data", + "resource": "doc://modules/openapi_first.templates.vet_app.data" + }, + { + "module": "openapi_first.templates.vet_app.main", + "resource": "doc://modules/openapi_first.templates.vet_app.main" + }, + { + "module": "openapi_first.templates.vet_app.models", + "resource": "doc://modules/openapi_first.templates.vet_app.models" + }, + { + "module": "openapi_first.templates.vet_app.routes", + "resource": "doc://modules/openapi_first.templates.vet_app.routes" + }, + { + "module": "openapi_first.templates.vet_app.sse", + "resource": "doc://modules/openapi_first.templates.vet_app.sse" + }, + { + "module": "openapi_first.templates.vet_app.test_vet_app", + "resource": "doc://modules/openapi_first.templates.vet_app.test_vet_app" } ] \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.json b/mcp_docs/modules/openapi_first.json deleted file mode 100644 index 789aa8a..0000000 --- a/mcp_docs/modules/openapi_first.json +++ /dev/null @@ -1,1091 +0,0 @@ -{ - "module": "openapi_first", - "content": { - "path": "openapi_first", - "docstring": "# Summary\n\nFastAPI OpenAPI First — strict OpenAPI-first application bootstrap for FastAPI.\n\nFastAPI OpenAPI First is a **contract-first infrastructure library** that\nenforces OpenAPI as the single source of truth for FastAPI services.\n\nThe library removes decorator-driven routing and replaces it with\ndeterministic, spec-driven application assembly. Every HTTP route,\nmethod, and operation is defined in OpenAPI first and bound to Python\nhandlers explicitly via `operationId`.\n\n---\n\n# Installation\n\nInstall using pip:\n\n```bash\npip install openapi-first\n```\n\nOr with Poetry:\n\n```bash\npoetry add openapi-first\n```\n\n---\n\n# Quick Start\n\nMinimal OpenAPI-first FastAPI application:\n\n```python\nfrom openapi_first import app\nimport my_service.routes as routes\n\napi = app.OpenAPIFirstApp(\n openapi_path=\"openapi.yaml\",\n routes_module=routes,\n title=\"My Service\",\n version=\"1.0.0\",\n)\n```\n\nOperationId-driven HTTP client:\n\n```python\nfrom openapi_first.loader import load_openapi\nfrom openapi_first.client import OpenAPIClient\n\nspec = load_openapi(\"openapi.yaml\")\nclient = OpenAPIClient(spec)\n\nresponse = client.get_health()\n```\n\n---\n\n# Architecture\n\nThe library is structured around four core responsibilities:\n\n- `loader`: Load and validate OpenAPI 3.x specifications (JSON/YAML).\n- `binder`: Bind OpenAPI operations to FastAPI routes via `operationId`.\n- `app`: OpenAPI-first FastAPI application bootstrap.\n- `client`: OpenAPI-first HTTP client driven by the same specification.\n- `errors`: Explicit error hierarchy for contract violations.\n\n---\n\n# Public API\n\nThe supported public API consists of the following top-level modules:\n\n- `openapi_first.app`\n- `openapi_first.binder`\n- `openapi_first.loader`\n- `openapi_first.client`\n- `openapi_first.errors`\n\n---\n\n# Design Guarantees\n\n- OpenAPI is the single source of truth.\n- No undocumented routes can exist.\n- No OpenAPI operation can exist without a handler or client callable.\n- All contract violations fail at application startup or client creation.\n- No hidden FastAPI magic or implicit behavior.\n- Deterministic, testable application assembly.\n\n---", - "objects": { - "app": { - "name": "app", - "kind": "module", - "path": "openapi_first.app", - "signature": null, - "docstring": "# Summary\n\nOpenAPI-first application bootstrap for FastAPI.\n\nThis module provides `OpenAPIFirstApp`, a thin but strict abstraction\nthat enforces OpenAPI as the single source of truth for a FastAPI service.\n\nNotes:\n **Core Principles:**\n\n - The OpenAPI specification (JSON or YAML) defines the entire API surface.\n - Every `operationId` in the OpenAPI spec must have a corresponding\n Python handler function.\n - Handlers are plain Python callables (no FastAPI decorators).\n - FastAPI route registration is derived exclusively from the spec.\n - FastAPI's autogenerated OpenAPI schema is fully overridden.\n\n **Responsibilities:**\n\n - Loads and validates an OpenAPI 3.x specification.\n - Dynamically binds HTTP routes to handler functions using `operationId`.\n - Registers routes with FastAPI at application startup.\n - Ensures runtime behavior matches the OpenAPI contract exactly.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Generate OpenAPI specs.\n - Generate client code.\n - Introduce a new framework or lifecycle.\n - Alter FastAPI dependency injection semantics.", - "members": { - "FastAPI": { - "name": "FastAPI", - "kind": "alias", - "path": "openapi_first.app.FastAPI", - "signature": "", - "docstring": null - }, - "load_openapi": { - "name": "load_openapi", - "kind": "function", - "path": "openapi_first.app.load_openapi", - "signature": "", - "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "bind_routes": { - "name": "bind_routes", - "kind": "function", - "path": "openapi_first.app.bind_routes", - "signature": "", - "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n\nRaises:\n MissingOperationHandler:\n If an `operationId` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each `operationId` to a handler function, and registers\n a corresponding `APIRoute` on the FastAPI application.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." - }, - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.app.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.app.OpenAPIFirstApp.openapi", - "signature": null, - "docstring": null - } - } - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "openapi_first.app.Any", - "signature": "", - "docstring": null - } - } - }, - "binder": { - "name": "binder", - "kind": "module", - "path": "openapi_first.binder", - "signature": null, - "docstring": "# Summary\n\nOpenAPI-driven route binding for FastAPI.\n\nThis module is responsible for translating an OpenAPI 3.x specification\ninto concrete FastAPI routes. It enforces a strict one-to-one mapping\nbetween OpenAPI operations and Python handler functions using `operationId`.\n\nNotes:\n **Core Responsibility:**\n\n - Read path + method definitions from an OpenAPI specification.\n - Resolve each `operationId` to a Python callable.\n - Register routes with FastAPI using `APIRoute`.\n - Fail fast when contract violations are detected.\n\n **Design Constraints:**\n\n - All routes MUST be declared in the OpenAPI specification.\n - All OpenAPI operations MUST define an `operationId`.\n - Every `operationId` MUST resolve to a handler function.\n - Handlers are plain Python callables (no decorators required).\n - No implicit route creation or inference is allowed.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Perform request or response validation.\n - Generate Pydantic models.\n - Modify FastAPI dependency injection.\n - Interpret OpenAPI semantics beyond routing metadata.", - "members": { - "APIRoute": { - "name": "APIRoute", - "kind": "alias", - "path": "openapi_first.binder.APIRoute", - "signature": "", - "docstring": null - }, - "MissingOperationHandler": { - "name": "MissingOperationHandler", - "kind": "class", - "path": "openapi_first.binder.MissingOperationHandler", - "signature": "", - "docstring": "Raised when an OpenAPI operation cannot be resolved to a handler.\n\nNotes:\n **Scenarios:**\n\n - An OpenAPI operation does not define an `operationId`.\n - An `operationId` is defined but no matching function exists in\n the provided routes module.\n\n **Guarantees:**\n\n - This represents a violation of the OpenAPI-first contract and\n indicates that the specification and implementation are out of\n sync." - }, - "bind_routes": { - "name": "bind_routes", - "kind": "function", - "path": "openapi_first.binder.bind_routes", - "signature": "", - "docstring": "Bind OpenAPI operations to FastAPI routes.\n\nArgs:\n app (fastapi.FastAPI):\n The FastAPI application instance to which routes will be added.\n spec (dict):\n Parsed OpenAPI 3.x specification dictionary.\n routes_module (module):\n Python module containing handler functions. Each handler's name MUST\n exactly match an OpenAPI `operationId`.\n\nRaises:\n MissingOperationHandler:\n If an `operationId` is missing from the spec or if no corresponding\n handler function exists in the routes module.\n\nNotes:\n **Responsibilities:**\n\n - Iterates through the OpenAPI specification paths and methods.\n - Resolves each `operationId` to a handler function, and registers\n a corresponding `APIRoute` on the FastAPI application.\n\n **Guarantees:**\n\n - Route registration is deterministic and spec-driven. No route\n decorators are required or supported. Handler resolution errors\n surface at application startup." - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "openapi_first.binder.Any", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.binder.Dict", - "signature": "", - "docstring": null - }, - "FastAPI": { - "name": "FastAPI", - "kind": "alias", - "path": "openapi_first.binder.FastAPI", - "signature": "", - "docstring": null - } - } - }, - "cli": { - "name": "cli", - "kind": "module", - "path": "openapi_first.cli", - "signature": null, - "docstring": "Command-line interface for FastAPI OpenAPI-first scaffolding utilities.\n\n---\n\n## Summary\n\nThis CLI bootstraps OpenAPI-first FastAPI applications from versioned,\nbundled templates packaged with the library.", - "members": { - "argparse": { - "name": "argparse", - "kind": "alias", - "path": "openapi_first.cli.argparse", - "signature": "", - "docstring": null - }, - "shutil": { - "name": "shutil", - "kind": "alias", - "path": "openapi_first.cli.shutil", - "signature": "", - "docstring": null - }, - "Path": { - "name": "Path", - "kind": "alias", - "path": "openapi_first.cli.Path", - "signature": "", - "docstring": null - }, - "resources": { - "name": "resources", - "kind": "alias", - "path": "openapi_first.cli.resources", - "signature": "", - "docstring": null - }, - "DEFAULT_TEMPLATE": { - "name": "DEFAULT_TEMPLATE", - "kind": "attribute", - "path": "openapi_first.cli.DEFAULT_TEMPLATE", - "signature": null, - "docstring": null - }, - "available_templates": { - "name": "available_templates", - "kind": "function", - "path": "openapi_first.cli.available_templates", - "signature": "", - "docstring": "Return a list of available application templates.\n\nReturns:\n list[str]:\n Sorted list of template names found in the internal templates directory." - }, - "copy_template": { - "name": "copy_template", - "kind": "function", - "path": "openapi_first.cli.copy_template", - "signature": "", - "docstring": "Copy a bundled OpenAPI-first application template into a directory.\n\nArgs:\n template (str):\n Name of the template to copy.\n target_dir (Path):\n Filesystem path where the template should be copied.\n\nRaises:\n FileNotFoundError:\n If the requested template does not exist." - }, - "main": { - "name": "main", - "kind": "function", - "path": "openapi_first.cli.main", - "signature": "", - "docstring": null - } - } - }, - "client": { - "name": "client", - "kind": "module", - "path": "openapi_first.client", - "signature": null, - "docstring": "# Summary\n\nOpenAPI-first HTTP client for contract-driven services.\n\nThis module provides `OpenAPIClient`, a thin, strict HTTP client that\nderives all callable operations directly from an OpenAPI 3.x specification.\n\nIt is the client counterpart to `OpenAPIFirstApp`.\n\nNotes:\n **Core Principles:**\n\n - The OpenAPI specification is the single source of truth\n - Each operationId becomes a callable Python method\n - No implicit schema mutation or inference\n - No code generation step\n - Minimal abstraction over httpx\n\n **Responsibilities:**\n\n - Parses an OpenAPI 3.x specification\n - Dynamically creates one callable per operationId\n - Enforces presence of servers, paths, and operationId\n - Formats path parameters safely\n - Handles JSON request bodies explicitly\n - Returns raw `httpx.Response` objects\n\n **Constraints:**\n\n - This module intentionally does NOT: Generate client code, validate request/response schemas, deserialize responses, retry requests, implement authentication helpers, or assume non-2xx responses are failures.", - "members": { - "Any": { - "name": "Any", - "kind": "alias", - "path": "openapi_first.client.Any", - "signature": "", - "docstring": null - }, - "Callable": { - "name": "Callable", - "kind": "alias", - "path": "openapi_first.client.Callable", - "signature": "", - "docstring": null - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.client.Dict", - "signature": "", - "docstring": null - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "openapi_first.client.Optional", - "signature": "", - "docstring": null - }, - "urljoin": { - "name": "urljoin", - "kind": "alias", - "path": "openapi_first.client.urljoin", - "signature": "", - "docstring": null - }, - "httpx": { - "name": "httpx", - "kind": "alias", - "path": "openapi_first.client.httpx", - "signature": "", - "docstring": null - }, - "OpenAPIFirstError": { - "name": "OpenAPIFirstError", - "kind": "class", - "path": "openapi_first.client.OpenAPIFirstError", - "signature": "", - "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." - }, - "OpenAPIClientError": { - "name": "OpenAPIClientError", - "kind": "class", - "path": "openapi_first.client.OpenAPIClientError", - "signature": "", - "docstring": "Raised when an OpenAPI client operation fails." - }, - "OpenAPIClient": { - "name": "OpenAPIClient", - "kind": "class", - "path": "openapi_first.client.OpenAPIClient", - "signature": "", - "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", - "members": { - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.client.OpenAPIClient.spec", - "signature": null, - "docstring": null - }, - "base_url": { - "name": "base_url", - "kind": "attribute", - "path": "openapi_first.client.OpenAPIClient.base_url", - "signature": null, - "docstring": null - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.client.OpenAPIClient.client", - "signature": null, - "docstring": null - }, - "operations": { - "name": "operations", - "kind": "function", - "path": "openapi_first.client.OpenAPIClient.operations", - "signature": "", - "docstring": null - } - } - } - } - }, - "errors": { - "name": "errors", - "kind": "module", - "path": "openapi_first.errors", - "signature": null, - "docstring": "# Summary\n\nExceptions for OpenAPI-first FastAPI applications.\n\nThis module defines a small hierarchy of explicit, intention-revealing\nexceptions used to signal contract violations between an OpenAPI\nspecification and its Python implementation.\n\nNotes:\n **Design Principles:**\n\n - Errors represent programmer mistakes, not runtime conditions.\n - All errors are raised during application startup.\n - Messages are actionable and suitable for CI/CD output.\n - Exceptions are explicit rather than reused from generic built-ins.\n\n These errors should normally cause immediate application failure.", - "members": { - "OpenAPIFirstError": { - "name": "OpenAPIFirstError", - "kind": "class", - "path": "openapi_first.errors.OpenAPIFirstError", - "signature": "", - "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." - }, - "MissingOperationHandler": { - "name": "MissingOperationHandler", - "kind": "class", - "path": "openapi_first.errors.MissingOperationHandler", - "signature": "", - "docstring": "Raised when an OpenAPI operation cannot be resolved to a handler.\n\nNotes:\n **Scenarios:**\n\n - An OpenAPI operation does not define an `operationId`.\n - An `operationId` is defined but no matching function exists in\n the provided routes module.\n\n **Guarantees:**\n\n - This represents a violation of the OpenAPI-first contract and\n indicates that the specification and implementation are out of\n sync." - }, - "Optional": { - "name": "Optional", - "kind": "alias", - "path": "openapi_first.errors.Optional", - "signature": "", - "docstring": null - } - } - }, - "loader": { - "name": "loader", - "kind": "module", - "path": "openapi_first.loader", - "signature": null, - "docstring": "# Summary\n\nOpenAPI specification loading and validation utilities.\n\nThis module is responsible for loading an OpenAPI 3.x specification\nfrom disk and validating it before it is used by the application.\n\nIt enforces the principle that an invalid or malformed OpenAPI document\nmust never reach the routing or runtime layers.\n\nNotes:\n **Design Principles:**\n\n - OpenAPI is treated as an authoritative contract.\n - Invalid specifications fail fast at application startup.\n - Supported formats are JSON and YAML.\n - Validation errors are surfaced clearly and early.\n\n **Constraints:**\n\n - This module intentionally does NOT:\n - Modify the OpenAPI document.\n - Infer missing fields.\n - Generate models or code.\n - Perform request/response validation at runtime.", - "members": { - "json": { - "name": "json", - "kind": "alias", - "path": "openapi_first.loader.json", - "signature": "", - "docstring": null - }, - "Path": { - "name": "Path", - "kind": "alias", - "path": "openapi_first.loader.Path", - "signature": "", - "docstring": null - }, - "Any": { - "name": "Any", - "kind": "alias", - "path": "openapi_first.loader.Any", - "signature": "", - "docstring": null - }, - "yaml": { - "name": "yaml", - "kind": "alias", - "path": "openapi_first.loader.yaml", - "signature": "", - "docstring": null - }, - "validate_spec": { - "name": "validate_spec", - "kind": "alias", - "path": "openapi_first.loader.validate_spec", - "signature": "", - "docstring": null - }, - "OpenAPIFirstError": { - "name": "OpenAPIFirstError", - "kind": "class", - "path": "openapi_first.loader.OpenAPIFirstError", - "signature": "", - "docstring": "Base exception for all OpenAPI-first enforcement errors.\n\nNotes:\n **Responsibilities:**\n\n - This exception exists to allow callers, test suites, and CI\n pipelines to catch and distinguish OpenAPI contract violations\n from unrelated runtime errors.\n - All exceptions raised by the OpenAPI-first core should inherit\n from this type." - }, - "OpenAPISpecLoadError": { - "name": "OpenAPISpecLoadError", - "kind": "class", - "path": "openapi_first.loader.OpenAPISpecLoadError", - "signature": "", - "docstring": "Raised when an OpenAPI specification cannot be loaded or validated.\n\nNotes:\n **Guarantees:**\n\n - This error indicates that the OpenAPI document is unreadable,\n malformed, or violates the OpenAPI 3.x specification." - }, - "load_openapi": { - "name": "load_openapi", - "kind": "function", - "path": "openapi_first.loader.load_openapi", - "signature": "", - "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.loader.Dict", - "signature": "", - "docstring": null - }, - "Union": { - "name": "Union", - "kind": "alias", - "path": "openapi_first.loader.Union", - "signature": "", - "docstring": null - } - } - }, - "templates": { - "name": "templates", - "kind": "module", - "path": "openapi_first.templates", - "signature": null, - "docstring": "Application templates for FastAPI OpenAPI First.\n\nThis package contains example and scaffolding templates intended to be\ncopied into user projects via the ``openapi-first`` CLI.\n\nTemplates in this package are:\n- Reference implementations of OpenAPI-first services\n- Not part of the ``openapi_first`` public or internal API\n- Not intended to be imported as runtime dependencies\n\nThe presence of this file exists solely to:\n- Mark the directory as an explicit Python package\n- Enable deterministic tooling behavior (documentation, packaging)\n- Avoid accidental traversal of non-package directories\n\nNo code in this package should be imported by library consumers.", - "members": { - "crud_app": { - "name": "crud_app", - "kind": "module", - "path": "openapi_first.templates.crud_app", - "signature": null, - "docstring": "OpenAPI-first CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new CRUD example service using the bundled template:\n\n openapi-first crud_app\n\nCreate the service in a custom directory:\n\n openapi-first crud_app my-crud-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", - "members": { - "data": { - "name": "data", - "kind": "module", - "path": "openapi_first.templates.crud_app.data", - "signature": null, - "docstring": "In-memory mock data store for CRUD example.\n\nThis module intentionally avoids persistence and concurrency guarantees.\nIt is suitable for demos, tests, and scaffolding only.\n\nIt intentionally avoids\n- persistence\n- concurrency guarantees\n- validation\n- error handling\n\nThe implementation is suitable for:\n- demonstrations\n- tests\n- scaffolding and example services\n\nIt is explicitly NOT suitable for production use.\n\nThis module is not part of the ``openapi_first`` library API surface.", - "members": { - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.templates.crud_app.data.Dict", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.list_items", - "signature": "", - "docstring": "Return all items in the data store.\n\nThis function performs no filtering, pagination, or sorting.\nThe returned collection reflects the current in-memory state.\n\nReturns\n-------\nlist[dict]\n A list of item representations." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present in the store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The stored item representation." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.create_item", - "signature": "", - "docstring": "Create a new item in the data store.\n\nA new integer ID is assigned automatically. No validation is\nperformed on the provided payload.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The newly created item, including its assigned ID." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.update_item", - "signature": "", - "docstring": "Replace an existing item in the data store.\n\nThis function overwrites the existing item entirely and does not\nperform partial updates or validation. If the item does not exist,\nit will be created implicitly.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item representation." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.delete_item", - "signature": "", - "docstring": "Remove an item from the data store.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete." - } - } - }, - "main": { - "name": "main", - "kind": "module", - "path": "openapi_first.templates.crud_app.main", - "signature": null, - "docstring": "Application entry point for an OpenAPI-first CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", - "members": { - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp.openapi", - "signature": "", - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "alias", - "path": "openapi_first.templates.crud_app.main.routes", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.main.app", - "signature": null, - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "module", - "path": "openapi_first.templates.crud_app.routes", - "signature": null, - "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThese handlers explicitly control HTTP status codes to ensure\nruntime behavior matches the OpenAPI contract.\n\nThis module defines OpenAPI-bound operation handlers for a simple CRUD\nservice. Functions in this module are bound to HTTP routes exclusively\nvia OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Error conditions are translated\ninto explicit HTTP responses rather than relying on implicit framework\nbehavior.\n\nNo routing decorators or path definitions appear in this module. All\nrouting, HTTP methods, and schemas are defined in the OpenAPI\nspecification.", - "members": { - "Response": { - "name": "Response", - "kind": "alias", - "path": "openapi_first.templates.crud_app.routes.Response", - "signature": "", - "docstring": null - }, - "HTTPException": { - "name": "HTTPException", - "kind": "alias", - "path": "openapi_first.templates.crud_app.routes.HTTPException", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.list_items", - "signature": "", - "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[dict]\n A list of item representations." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.create_item", - "signature": "", - "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\ndict\n The newly created item." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.update_item", - "signature": "", - "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.delete_item", - "signature": "", - "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - } - } - }, - "test_crud_app": { - "name": "test_crud_app", - "kind": "module", - "path": "openapi_first.templates.crud_app.test_crud_app", - "signature": null, - "docstring": "End-to-end tests for the OpenAPI-first CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Correct HTTP status codes and response payloads\n\nThe tests exercise all CRUD operations against an in-memory mock data\nstore and assume deterministic behavior within a single process.\n\nThe tests assume:\n- OpenAPI-first route binding\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process\n- One-to-one correspondence between OpenAPI operationId values and\n server/client callables", - "members": { - "TestClient": { - "name": "TestClient", - "kind": "alias", - "path": "openapi_first.templates.crud_app.test_crud_app.TestClient", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "alias", - "path": "openapi_first.templates.crud_app.test_crud_app.app", - "signature": "", - "docstring": null - }, - "load_openapi": { - "name": "load_openapi", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.load_openapi", - "signature": "", - "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "OpenAPIClient": { - "name": "OpenAPIClient", - "kind": "class", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient", - "signature": "", - "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", - "members": { - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.spec", - "signature": "", - "docstring": null - }, - "base_url": { - "name": "base_url", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.base_url", - "signature": "", - "docstring": null - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.client", - "signature": "", - "docstring": null - }, - "operations": { - "name": "operations", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.operations", - "signature": "", - "docstring": null - } - } - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.client", - "signature": null, - "docstring": null - }, - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.spec", - "signature": null, - "docstring": null - }, - "test_list_items_initial": { - "name": "test_list_items_initial", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_list_items_initial", - "signature": "", - "docstring": "Initial items should be present." - }, - "test_get_item": { - "name": "test_get_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_get_item", - "signature": "", - "docstring": "Existing item should be retrievable by ID." - }, - "test_create_item": { - "name": "test_create_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_create_item", - "signature": "", - "docstring": "Creating a new item should return the created entity." - }, - "test_update_item": { - "name": "test_update_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_update_item", - "signature": "", - "docstring": "Updating an item should replace its values." - }, - "test_delete_item": { - "name": "test_delete_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_delete_item", - "signature": "", - "docstring": "Deleting an item should remove it from the store." - } - } - } - } - }, - "health_app": { - "name": "health_app", - "kind": "module", - "path": "openapi_first.templates.health_app", - "signature": null, - "docstring": "OpenAPI-first FastAPI application template.\n\nThis package contains a minimal, fully working example of an\nOpenAPI-first FastAPI service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace (``routes``)\n\nNo routing decorators, implicit behavior, or framework-specific\nconvenience abstractions are used. All HTTP routes, methods, and\noperation bindings are defined in OpenAPI and enforced at application\nstartup.\n\nThis package is intended to be copied as a starting point for new\nservices via the ``openapi-first`` CLI. It is not part of the\n``openapi_first`` library API surface.\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new OpenAPI-first health check service using the bundled\ntemplate:\n\n openapi-first health_app\n\nCreate the service in a custom directory:\n\n openapi-first health_app my-health-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client call for the ``get_health`` operation:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n response = client.get_health()\n\n assert response.status_code == 200\n assert response.json() == {\"status\": \"ok\"}\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time", - "members": { - "main": { - "name": "main", - "kind": "module", - "path": "openapi_first.templates.health_app.main", - "signature": null, - "docstring": "Application entry point for an OpenAPI-first FastAPI service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, and operation bindings are defined in the\nOpenAPI document referenced by ``openapi_path``. Python callables\ndefined in the ``routes`` module are bound to OpenAPI operations\nstrictly via ``operationId``.\n\nThis module contains no routing logic, request handling, or framework\nconfiguration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", - "members": { - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp.openapi", - "signature": "", - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "alias", - "path": "openapi_first.templates.health_app.main.routes", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "openapi_first.templates.health_app.main.app", - "signature": null, - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "module", - "path": "openapi_first.templates.health_app.routes", - "signature": null, - "docstring": "OpenAPI operation handlers.\n\nThis module defines pure Python callables that implement OpenAPI\noperations for this service. Functions in this module are bound to HTTP\nroutes exclusively via OpenAPI ``operationId`` values.\n\nNo routing decorators, HTTP metadata, or framework-specific logic\nshould appear here. All request/response semantics are defined in the\nOpenAPI specification.\n\nThis module serves solely as an operationId namespace.", - "members": { - "get_health": { - "name": "get_health", - "kind": "function", - "path": "openapi_first.templates.health_app.routes.get_health", - "signature": "", - "docstring": "Health check operation handler.\n\nThis function implements the OpenAPI operation identified by\n``operationId: get_health``.\n\nIt contains no routing metadata or framework-specific logic.\nRequest binding, HTTP method, and response semantics are defined\nexclusively by the OpenAPI specification.\n\nReturns\n-------\ndict\n A minimal liveness payload indicating service health." - } - } - } - } - }, - "model_app": { - "name": "model_app", - "kind": "module", - "path": "openapi_first.templates.model_app", - "signature": null, - "docstring": "OpenAPI-first model-based CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service that uses explicit Pydantic domain models for request and\nresponse schemas.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- Pydantic domain models (``models``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit request and response modeling with Pydantic\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new model-based CRUD example service using the bundled template:\n\n openapi-first model_app\n\nCreate the service in a custom directory:\n\n openapi-first model_app my-model-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for model-based CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Request and response payloads conform to Pydantic models\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", - "members": { - "data": { - "name": "data", - "kind": "module", - "path": "openapi_first.templates.model_app.data", - "signature": null, - "docstring": "In-memory data store using Pydantic models.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\nThis module provides a minimal, process-local data store for the\nmodel-based CRUD example application. It stores and returns domain\nobjects defined using Pydantic models and is intended solely for\ndemonstration and scaffolding purposes.\n\nThe implementation intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nIt is not part of the ``openapi_first`` library API surface.", - "members": { - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.templates.model_app.data.Dict", - "signature": "", - "docstring": null - }, - "Item": { - "name": "Item", - "kind": "alias", - "path": "openapi_first.templates.model_app.data.Item", - "signature": "", - "docstring": null - }, - "ItemCreate": { - "name": "ItemCreate", - "kind": "alias", - "path": "openapi_first.templates.model_app.data.ItemCreate", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.model_app.data.list_items", - "signature": "", - "docstring": "Return all items in the data store.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nKeyError\n If the item does not exist." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.create_item", - "signature": "", - "docstring": "Create a new item in the data store.\n\nA new identifier is assigned automatically. No additional validation\nis performed beyond Pydantic model validation.\n\nParameters\n----------\npayload : ItemCreate\n Data required to create a new item.\n\nReturns\n-------\nItem\n The newly created item." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.update_item", - "signature": "", - "docstring": "Replace an existing item in the data store.\n\nThis function performs a full replacement of the stored item.\nPartial updates are not supported.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nKeyError\n If the item does not exist." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.delete_item", - "signature": "", - "docstring": "Remove an item from the data store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\n\nRaises\n------\nKeyError\n If the item does not exist." - } - } - }, - "main": { - "name": "main", - "kind": "module", - "path": "openapi_first.templates.model_app.main", - "signature": null, - "docstring": "Application entry point for an OpenAPI-first model-based CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", - "members": { - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp.openapi", - "signature": "", - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "alias", - "path": "openapi_first.templates.model_app.main.routes", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "openapi_first.templates.model_app.main.app", - "signature": null, - "docstring": null - } - } - }, - "models": { - "name": "models", - "kind": "module", - "path": "openapi_first.templates.model_app.models", - "signature": null, - "docstring": "Pydantic domain models for the CRUD example.\n\nThis module defines Pydantic models that represent the domain entities\nused by the service. These models are referenced by the OpenAPI\nspecification for request and response schemas.\n\nThe models are declarative and framework-agnostic. They contain no\npersistence logic, validation beyond type constraints, or business\nbehavior.\n\nThis module is not part of the ``openapi_first`` library API surface.\nIt exists solely to support the example application template.", - "members": { - "BaseModel": { - "name": "BaseModel", - "kind": "alias", - "path": "openapi_first.templates.model_app.models.BaseModel", - "signature": "", - "docstring": null - }, - "ItemBase": { - "name": "ItemBase", - "kind": "class", - "path": "openapi_first.templates.model_app.models.ItemBase", - "signature": "", - "docstring": "Base domain model for an item.\n\nDefines fields common to all item representations.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "openapi_first.templates.model_app.models.ItemBase.name", - "signature": null, - "docstring": null - }, - "price": { - "name": "price", - "kind": "attribute", - "path": "openapi_first.templates.model_app.models.ItemBase.price", - "signature": null, - "docstring": null - } - } - }, - "ItemCreate": { - "name": "ItemCreate", - "kind": "class", - "path": "openapi_first.templates.model_app.models.ItemCreate", - "signature": "", - "docstring": "Domain model for item creation requests.\n\nThis model is used for request bodies when creating new items.\nIt intentionally excludes the ``id`` field, which is assigned\nby the service." - }, - "Item": { - "name": "Item", - "kind": "class", - "path": "openapi_first.templates.model_app.models.Item", - "signature": "", - "docstring": "Domain model for a persisted item.\n\nThis model represents the full item state returned in responses,\nincluding the server-assigned identifier.", - "members": { - "id": { - "name": "id", - "kind": "attribute", - "path": "openapi_first.templates.model_app.models.Item.id", - "signature": null, - "docstring": null - } - } - } - } - }, - "routes": { - "name": "routes", - "kind": "module", - "path": "openapi_first.templates.model_app.routes", - "signature": null, - "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThis module defines OpenAPI-bound operation handlers for a model-based\nCRUD service. Functions in this module are bound to HTTP routes\nexclusively via OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", - "members": { - "Response": { - "name": "Response", - "kind": "alias", - "path": "openapi_first.templates.model_app.routes.Response", - "signature": "", - "docstring": null - }, - "HTTPException": { - "name": "HTTPException", - "kind": "alias", - "path": "openapi_first.templates.model_app.routes.HTTPException", - "signature": "", - "docstring": null - }, - "ItemCreate": { - "name": "ItemCreate", - "kind": "alias", - "path": "openapi_first.templates.model_app.routes.ItemCreate", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.list_items", - "signature": "", - "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.create_item", - "signature": "", - "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : ItemCreate\n Request body describing the item to create.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nItem\n The newly created item." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.update_item", - "signature": "", - "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.delete_item", - "signature": "", - "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - } - } - }, - "test_model_app": { - "name": "test_model_app", - "kind": "module", - "path": "openapi_first.templates.model_app.test_model_app", - "signature": null, - "docstring": "End-to-end tests for the OpenAPI-first model CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Pydantic model-based request and response handling\n\nAll CRUD operations are exercised against an in-memory mock data store\nbacked by Pydantic domain models.\n\nThe tests assume:\n- OpenAPI-first route binding\n- Pydantic model validation\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process", - "members": { - "TestClient": { - "name": "TestClient", - "kind": "alias", - "path": "openapi_first.templates.model_app.test_model_app.TestClient", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "alias", - "path": "openapi_first.templates.model_app.test_model_app.app", - "signature": "", - "docstring": null - }, - "load_openapi": { - "name": "load_openapi", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.load_openapi", - "signature": "", - "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "OpenAPIClient": { - "name": "OpenAPIClient", - "kind": "class", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient", - "signature": "", - "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", - "members": { - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.spec", - "signature": "", - "docstring": null - }, - "base_url": { - "name": "base_url", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.base_url", - "signature": "", - "docstring": null - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.client", - "signature": "", - "docstring": null - }, - "operations": { - "name": "operations", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.operations", - "signature": "", - "docstring": null - } - } - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.client", - "signature": null, - "docstring": null - }, - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.spec", - "signature": null, - "docstring": null - }, - "test_list_items_initial": { - "name": "test_list_items_initial", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_list_items_initial", - "signature": "", - "docstring": "Initial items should be present." - }, - "test_get_item": { - "name": "test_get_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_get_item", - "signature": "", - "docstring": "Existing item should be retrievable by ID." - }, - "test_create_item": { - "name": "test_create_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_create_item", - "signature": "", - "docstring": "Creating a new item should return the created entity." - }, - "test_update_item": { - "name": "test_update_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_update_item", - "signature": "", - "docstring": "Updating an item should replace its values." - }, - "test_delete_item": { - "name": "test_delete_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_delete_item", - "signature": "", - "docstring": "Deleting an item should remove it from the store." - } - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/mcp_docs/modules/openapi_first.templates.json b/mcp_docs/modules/openapi_first.templates.json deleted file mode 100644 index 19be3d9..0000000 --- a/mcp_docs/modules/openapi_first.templates.json +++ /dev/null @@ -1,702 +0,0 @@ -{ - "module": "openapi_first.templates", - "content": { - "path": "openapi_first.templates", - "docstring": "Application templates for FastAPI OpenAPI First.\n\nThis package contains example and scaffolding templates intended to be\ncopied into user projects via the ``openapi-first`` CLI.\n\nTemplates in this package are:\n- Reference implementations of OpenAPI-first services\n- Not part of the ``openapi_first`` public or internal API\n- Not intended to be imported as runtime dependencies\n\nThe presence of this file exists solely to:\n- Mark the directory as an explicit Python package\n- Enable deterministic tooling behavior (documentation, packaging)\n- Avoid accidental traversal of non-package directories\n\nNo code in this package should be imported by library consumers.", - "objects": { - "crud_app": { - "name": "crud_app", - "kind": "module", - "path": "openapi_first.templates.crud_app", - "signature": null, - "docstring": "OpenAPI-first CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new CRUD example service using the bundled template:\n\n openapi-first crud_app\n\nCreate the service in a custom directory:\n\n openapi-first crud_app my-crud-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", - "members": { - "data": { - "name": "data", - "kind": "module", - "path": "openapi_first.templates.crud_app.data", - "signature": null, - "docstring": "In-memory mock data store for CRUD example.\n\nThis module intentionally avoids persistence and concurrency guarantees.\nIt is suitable for demos, tests, and scaffolding only.\n\nIt intentionally avoids\n- persistence\n- concurrency guarantees\n- validation\n- error handling\n\nThe implementation is suitable for:\n- demonstrations\n- tests\n- scaffolding and example services\n\nIt is explicitly NOT suitable for production use.\n\nThis module is not part of the ``openapi_first`` library API surface.", - "members": { - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.templates.crud_app.data.Dict", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.list_items", - "signature": "", - "docstring": "Return all items in the data store.\n\nThis function performs no filtering, pagination, or sorting.\nThe returned collection reflects the current in-memory state.\n\nReturns\n-------\nlist[dict]\n A list of item representations." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present in the store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The stored item representation." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.create_item", - "signature": "", - "docstring": "Create a new item in the data store.\n\nA new integer ID is assigned automatically. No validation is\nperformed on the provided payload.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The newly created item, including its assigned ID." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.update_item", - "signature": "", - "docstring": "Replace an existing item in the data store.\n\nThis function overwrites the existing item entirely and does not\nperform partial updates or validation. If the item does not exist,\nit will be created implicitly.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item representation." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.data.delete_item", - "signature": "", - "docstring": "Remove an item from the data store.\n\nThis function assumes the item exists and will raise ``KeyError``\nif the ID is not present.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete." - } - } - }, - "main": { - "name": "main", - "kind": "module", - "path": "openapi_first.templates.crud_app.main", - "signature": null, - "docstring": "Application entry point for an OpenAPI-first CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", - "members": { - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.main.OpenAPIFirstApp.openapi", - "signature": "", - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "alias", - "path": "openapi_first.templates.crud_app.main.routes", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.main.app", - "signature": null, - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "module", - "path": "openapi_first.templates.crud_app.routes", - "signature": null, - "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThese handlers explicitly control HTTP status codes to ensure\nruntime behavior matches the OpenAPI contract.\n\nThis module defines OpenAPI-bound operation handlers for a simple CRUD\nservice. Functions in this module are bound to HTTP routes exclusively\nvia OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Error conditions are translated\ninto explicit HTTP responses rather than relying on implicit framework\nbehavior.\n\nNo routing decorators or path definitions appear in this module. All\nrouting, HTTP methods, and schemas are defined in the OpenAPI\nspecification.", - "members": { - "Response": { - "name": "Response", - "kind": "alias", - "path": "openapi_first.templates.crud_app.routes.Response", - "signature": "", - "docstring": null - }, - "HTTPException": { - "name": "HTTPException", - "kind": "alias", - "path": "openapi_first.templates.crud_app.routes.HTTPException", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.list_items", - "signature": "", - "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[dict]\n A list of item representations." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\ndict\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.create_item", - "signature": "", - "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : dict\n Item attributes excluding the ``id`` field.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\ndict\n The newly created item." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.update_item", - "signature": "", - "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : dict\n Item attributes excluding the ``id`` field.\n\nReturns\n-------\ndict\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.routes.delete_item", - "signature": "", - "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - } - } - }, - "test_crud_app": { - "name": "test_crud_app", - "kind": "module", - "path": "openapi_first.templates.crud_app.test_crud_app", - "signature": null, - "docstring": "End-to-end tests for the OpenAPI-first CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Correct HTTP status codes and response payloads\n\nThe tests exercise all CRUD operations against an in-memory mock data\nstore and assume deterministic behavior within a single process.\n\nThe tests assume:\n- OpenAPI-first route binding\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process\n- One-to-one correspondence between OpenAPI operationId values and\n server/client callables", - "members": { - "TestClient": { - "name": "TestClient", - "kind": "alias", - "path": "openapi_first.templates.crud_app.test_crud_app.TestClient", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "alias", - "path": "openapi_first.templates.crud_app.test_crud_app.app", - "signature": "", - "docstring": null - }, - "load_openapi": { - "name": "load_openapi", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.load_openapi", - "signature": "", - "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "OpenAPIClient": { - "name": "OpenAPIClient", - "kind": "class", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient", - "signature": "", - "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", - "members": { - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.spec", - "signature": "", - "docstring": null - }, - "base_url": { - "name": "base_url", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.base_url", - "signature": "", - "docstring": null - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.client", - "signature": "", - "docstring": null - }, - "operations": { - "name": "operations", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.OpenAPIClient.operations", - "signature": "", - "docstring": null - } - } - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.client", - "signature": null, - "docstring": null - }, - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.crud_app.test_crud_app.spec", - "signature": null, - "docstring": null - }, - "test_list_items_initial": { - "name": "test_list_items_initial", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_list_items_initial", - "signature": "", - "docstring": "Initial items should be present." - }, - "test_get_item": { - "name": "test_get_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_get_item", - "signature": "", - "docstring": "Existing item should be retrievable by ID." - }, - "test_create_item": { - "name": "test_create_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_create_item", - "signature": "", - "docstring": "Creating a new item should return the created entity." - }, - "test_update_item": { - "name": "test_update_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_update_item", - "signature": "", - "docstring": "Updating an item should replace its values." - }, - "test_delete_item": { - "name": "test_delete_item", - "kind": "function", - "path": "openapi_first.templates.crud_app.test_crud_app.test_delete_item", - "signature": "", - "docstring": "Deleting an item should remove it from the store." - } - } - } - } - }, - "health_app": { - "name": "health_app", - "kind": "module", - "path": "openapi_first.templates.health_app", - "signature": null, - "docstring": "OpenAPI-first FastAPI application template.\n\nThis package contains a minimal, fully working example of an\nOpenAPI-first FastAPI service built using the ``openapi_first`` library.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace (``routes``)\n\nNo routing decorators, implicit behavior, or framework-specific\nconvenience abstractions are used. All HTTP routes, methods, and\noperation bindings are defined in OpenAPI and enforced at application\nstartup.\n\nThis package is intended to be copied as a starting point for new\nservices via the ``openapi-first`` CLI. It is not part of the\n``openapi_first`` library API surface.\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new OpenAPI-first health check service using the bundled\ntemplate:\n\n openapi-first health_app\n\nCreate the service in a custom directory:\n\n openapi-first health_app my-health-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client call for the ``get_health`` operation:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n response = client.get_health()\n\n assert response.status_code == 200\n assert response.json() == {\"status\": \"ok\"}\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Path and request parameters must match the OpenAPI specification\n- Invalid or incomplete OpenAPI specs fail at client construction time", - "members": { - "main": { - "name": "main", - "kind": "module", - "path": "openapi_first.templates.health_app.main", - "signature": null, - "docstring": "Application entry point for an OpenAPI-first FastAPI service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, and operation bindings are defined in the\nOpenAPI document referenced by ``openapi_path``. Python callables\ndefined in the ``routes`` module are bound to OpenAPI operations\nstrictly via ``operationId``.\n\nThis module contains no routing logic, request handling, or framework\nconfiguration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", - "members": { - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.templates.health_app.main.OpenAPIFirstApp.openapi", - "signature": "", - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "alias", - "path": "openapi_first.templates.health_app.main.routes", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "openapi_first.templates.health_app.main.app", - "signature": null, - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "module", - "path": "openapi_first.templates.health_app.routes", - "signature": null, - "docstring": "OpenAPI operation handlers.\n\nThis module defines pure Python callables that implement OpenAPI\noperations for this service. Functions in this module are bound to HTTP\nroutes exclusively via OpenAPI ``operationId`` values.\n\nNo routing decorators, HTTP metadata, or framework-specific logic\nshould appear here. All request/response semantics are defined in the\nOpenAPI specification.\n\nThis module serves solely as an operationId namespace.", - "members": { - "get_health": { - "name": "get_health", - "kind": "function", - "path": "openapi_first.templates.health_app.routes.get_health", - "signature": "", - "docstring": "Health check operation handler.\n\nThis function implements the OpenAPI operation identified by\n``operationId: get_health``.\n\nIt contains no routing metadata or framework-specific logic.\nRequest binding, HTTP method, and response semantics are defined\nexclusively by the OpenAPI specification.\n\nReturns\n-------\ndict\n A minimal liveness payload indicating service health." - } - } - } - } - }, - "model_app": { - "name": "model_app", - "kind": "module", - "path": "openapi_first.templates.model_app", - "signature": null, - "docstring": "OpenAPI-first model-based CRUD application template.\n\nThis package contains a complete, minimal example of an OpenAPI-first\nCRUD service that uses explicit Pydantic domain models for request and\nresponse schemas.\n\nThe application is assembled exclusively from:\n- an OpenAPI specification (``openapi.yaml``)\n- a handler namespace implementing CRUD operations (``routes``)\n- Pydantic domain models (``models``)\n- an in-memory mock data store (``data``)\n\nAll HTTP routes, methods, schemas, and operation bindings are defined\nin the OpenAPI specification and enforced at application startup.\nNo decorator-driven routing or implicit framework behavior is used.\n\nThis template demonstrates:\n- operationId-driven server-side route binding\n- explicit request and response modeling with Pydantic\n- explicit HTTP status code control in handlers\n- operationId-driven client usage against the same OpenAPI contract\n- end-to-end validation using in-memory data and tests\n\n----------------------------------------------------------------------\nScaffolding via CLI\n----------------------------------------------------------------------\n\nCreate a new model-based CRUD example service using the bundled template:\n\n openapi-first model_app\n\nCreate the service in a custom directory:\n\n openapi-first model_app my-model-service\n\nList all available application templates:\n\n openapi-first --list\n\nThe CLI copies template files verbatim into the target directory.\nNo code is generated or modified beyond the copied scaffold.\n\n----------------------------------------------------------------------\nClient Usage Example\n----------------------------------------------------------------------\n\nThe same OpenAPI specification used by the server can be used to\nconstruct a strict, operationId-driven HTTP client.\n\nExample client calls for model-based CRUD operations:\n\n from openapi_first.loader import load_openapi\n from openapi_first.client import OpenAPIClient\n\n spec = load_openapi(\"openapi.yaml\")\n client = OpenAPIClient(spec)\n\n # List items\n response = client.list_items()\n\n # Get item by ID\n response = client.get_item(\n path_params={\"item_id\": 1}\n )\n\n # Create item\n response = client.create_item(\n body={\"name\": \"Orange\", \"price\": 0.8}\n )\n\n # Update item\n response = client.update_item(\n path_params={\"item_id\": 1},\n body={\"name\": \"Green Apple\", \"price\": 0.6},\n )\n\n # Delete item\n response = client.delete_item(\n path_params={\"item_id\": 1}\n )\n\nClient guarantees:\n- One callable per OpenAPI ``operationId``\n- No hardcoded URLs or HTTP methods in user code\n- Request and response payloads conform to Pydantic models\n- Invalid or incomplete OpenAPI specs fail at client construction time\n\n----------------------------------------------------------------------\nNon-Goals\n----------------------------------------------------------------------\n\nThis template is intentionally minimal and is NOT:\n- production-ready\n- persistent or concurrency-safe\n- a reference architecture for data storage\n\nIt exists solely as a copyable example for learning, testing, and\nbootstrapping OpenAPI-first services.\n\nThis package is not part of the ``openapi_first`` library API surface.", - "members": { - "data": { - "name": "data", - "kind": "module", - "path": "openapi_first.templates.model_app.data", - "signature": null, - "docstring": "In-memory data store using Pydantic models.\n\nThis module is NOT thread-safe and is intended for demos and scaffolds only.\nThis module provides a minimal, process-local data store for the\nmodel-based CRUD example application. It stores and returns domain\nobjects defined using Pydantic models and is intended solely for\ndemonstration and scaffolding purposes.\n\nThe implementation intentionally avoids:\n- persistence\n- concurrency guarantees\n- transactional semantics\n- validation beyond what Pydantic provides\n\nIt is not part of the ``openapi_first`` library API surface.", - "members": { - "Dict": { - "name": "Dict", - "kind": "alias", - "path": "openapi_first.templates.model_app.data.Dict", - "signature": "", - "docstring": null - }, - "Item": { - "name": "Item", - "kind": "alias", - "path": "openapi_first.templates.model_app.data.Item", - "signature": "", - "docstring": null - }, - "ItemCreate": { - "name": "ItemCreate", - "kind": "alias", - "path": "openapi_first.templates.model_app.data.ItemCreate", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.model_app.data.list_items", - "signature": "", - "docstring": "Return all items in the data store.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nKeyError\n If the item does not exist." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.create_item", - "signature": "", - "docstring": "Create a new item in the data store.\n\nA new identifier is assigned automatically. No additional validation\nis performed beyond Pydantic model validation.\n\nParameters\n----------\npayload : ItemCreate\n Data required to create a new item.\n\nReturns\n-------\nItem\n The newly created item." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.update_item", - "signature": "", - "docstring": "Replace an existing item in the data store.\n\nThis function performs a full replacement of the stored item.\nPartial updates are not supported.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nKeyError\n If the item does not exist." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.model_app.data.delete_item", - "signature": "", - "docstring": "Remove an item from the data store.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\n\nRaises\n------\nKeyError\n If the item does not exist." - } - } - }, - "main": { - "name": "main", - "kind": "module", - "path": "openapi_first.templates.model_app.main", - "signature": null, - "docstring": "Application entry point for an OpenAPI-first model-based CRUD example service.\n\nThis module constructs a FastAPI application exclusively from an\nOpenAPI specification and a handler namespace, without using\ndecorator-driven routing.\n\nAll HTTP routes, methods, request/response schemas, and operation\nbindings are defined in the OpenAPI document referenced by\n``openapi_path``. Python callables defined in the ``routes`` module are\nbound to OpenAPI operations strictly via ``operationId``.\n\nThis module contains no routing logic, persistence concerns, or\nframework configuration beyond application assembly.\n\nDesign guarantees:\n- OpenAPI is the single source of truth\n- No undocumented routes can exist\n- Every OpenAPI operationId must resolve to exactly one handler\n- All contract violations fail at application startup\n\nThis file is intended to be used as the ASGI entry point.\n\nExample:\n uvicorn main:app", - "members": { - "OpenAPIFirstApp": { - "name": "OpenAPIFirstApp", - "kind": "class", - "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp", - "signature": "", - "docstring": "FastAPI application enforcing OpenAPI-first design.\n\nNotes:\n **Responsibilities:**\n\n - `OpenAPIFirstApp` subclasses `FastAPI` and replaces manual route\n registration with OpenAPI-driven binding.\n - All routes are derived from the provided OpenAPI specification,\n and each `operationId` is mapped to a Python function in the\n supplied routes module.\n\n **Guarantees:**\n\n - No route can exist without an OpenAPI declaration.\n - No OpenAPI operation can exist without a handler.\n - Swagger UI and `/openapi.json` always reflect the provided spec.\n - Handler functions remain framework-agnostic and testable.\n\nExample:\n ```python\n from openapi_first import OpenAPIFirstApp\n import app.routes as routes\n\n app = OpenAPIFirstApp(\n openapi_path=\"app/openapi.json\",\n routes_module=routes,\n title=\"Example Service\",\n )\n ```", - "members": { - "openapi": { - "name": "openapi", - "kind": "attribute", - "path": "openapi_first.templates.model_app.main.OpenAPIFirstApp.openapi", - "signature": "", - "docstring": null - } - } - }, - "routes": { - "name": "routes", - "kind": "alias", - "path": "openapi_first.templates.model_app.main.routes", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "attribute", - "path": "openapi_first.templates.model_app.main.app", - "signature": null, - "docstring": null - } - } - }, - "models": { - "name": "models", - "kind": "module", - "path": "openapi_first.templates.model_app.models", - "signature": null, - "docstring": "Pydantic domain models for the CRUD example.\n\nThis module defines Pydantic models that represent the domain entities\nused by the service. These models are referenced by the OpenAPI\nspecification for request and response schemas.\n\nThe models are declarative and framework-agnostic. They contain no\npersistence logic, validation beyond type constraints, or business\nbehavior.\n\nThis module is not part of the ``openapi_first`` library API surface.\nIt exists solely to support the example application template.", - "members": { - "BaseModel": { - "name": "BaseModel", - "kind": "alias", - "path": "openapi_first.templates.model_app.models.BaseModel", - "signature": "", - "docstring": null - }, - "ItemBase": { - "name": "ItemBase", - "kind": "class", - "path": "openapi_first.templates.model_app.models.ItemBase", - "signature": "", - "docstring": "Base domain model for an item.\n\nDefines fields common to all item representations.", - "members": { - "name": { - "name": "name", - "kind": "attribute", - "path": "openapi_first.templates.model_app.models.ItemBase.name", - "signature": null, - "docstring": null - }, - "price": { - "name": "price", - "kind": "attribute", - "path": "openapi_first.templates.model_app.models.ItemBase.price", - "signature": null, - "docstring": null - } - } - }, - "ItemCreate": { - "name": "ItemCreate", - "kind": "class", - "path": "openapi_first.templates.model_app.models.ItemCreate", - "signature": "", - "docstring": "Domain model for item creation requests.\n\nThis model is used for request bodies when creating new items.\nIt intentionally excludes the ``id`` field, which is assigned\nby the service." - }, - "Item": { - "name": "Item", - "kind": "class", - "path": "openapi_first.templates.model_app.models.Item", - "signature": "", - "docstring": "Domain model for a persisted item.\n\nThis model represents the full item state returned in responses,\nincluding the server-assigned identifier.", - "members": { - "id": { - "name": "id", - "kind": "attribute", - "path": "openapi_first.templates.model_app.models.Item.id", - "signature": null, - "docstring": null - } - } - } - } - }, - "routes": { - "name": "routes", - "kind": "module", - "path": "openapi_first.templates.model_app.routes", - "signature": null, - "docstring": "CRUD route handlers bound via OpenAPI operationId.\n\nThis module defines OpenAPI-bound operation handlers for a model-based\nCRUD service. Functions in this module are bound to HTTP routes\nexclusively via OpenAPI ``operationId`` values.\n\nHandlers explicitly control HTTP response status codes to ensure runtime\nbehavior matches the OpenAPI contract. Domain models defined using\nPydantic are used for request and response payloads.\n\nNo routing decorators, path definitions, or implicit framework behavior\nappear in this module. All routing, HTTP methods, and schemas are defined\nin the OpenAPI specification.", - "members": { - "Response": { - "name": "Response", - "kind": "alias", - "path": "openapi_first.templates.model_app.routes.Response", - "signature": "", - "docstring": null - }, - "HTTPException": { - "name": "HTTPException", - "kind": "alias", - "path": "openapi_first.templates.model_app.routes.HTTPException", - "signature": "", - "docstring": null - }, - "ItemCreate": { - "name": "ItemCreate", - "kind": "alias", - "path": "openapi_first.templates.model_app.routes.ItemCreate", - "signature": "", - "docstring": null - }, - "list_items": { - "name": "list_items", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.list_items", - "signature": "", - "docstring": "List all items.\n\nImplements the OpenAPI operation identified by\n``operationId: list_items``.\n\nReturns\n-------\nlist[Item]\n A list of item domain objects." - }, - "get_item": { - "name": "get_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.get_item", - "signature": "", - "docstring": "Retrieve a single item by ID.\n\nImplements the OpenAPI operation identified by\n``operationId: get_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to retrieve.\n\nReturns\n-------\nItem\n The requested item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "create_item": { - "name": "create_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.create_item", - "signature": "", - "docstring": "Create a new item.\n\nImplements the OpenAPI operation identified by\n``operationId: create_item``.\n\nParameters\n----------\npayload : ItemCreate\n Request body describing the item to create.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nItem\n The newly created item." - }, - "update_item": { - "name": "update_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.update_item", - "signature": "", - "docstring": "Update an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: update_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to update.\npayload : ItemCreate\n New item data.\n\nReturns\n-------\nItem\n The updated item.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - }, - "delete_item": { - "name": "delete_item", - "kind": "function", - "path": "openapi_first.templates.model_app.routes.delete_item", - "signature": "", - "docstring": "Delete an existing item.\n\nImplements the OpenAPI operation identified by\n``operationId: delete_item``.\n\nParameters\n----------\nitem_id : int\n Identifier of the item to delete.\nresponse : fastapi.Response\n Response object used to set the HTTP status code.\n\nReturns\n-------\nNone\n No content.\n\nRaises\n------\nHTTPException\n 404 if the item does not exist." - } - } - }, - "test_model_app": { - "name": "test_model_app", - "kind": "module", - "path": "openapi_first.templates.model_app.test_model_app", - "signature": null, - "docstring": "End-to-end tests for the OpenAPI-first model CRUD example app.\n\nThese tests validate that all CRUD operations behave correctly\nagainst the in-memory mock data store using Pydantic models.\n- OpenAPI specification loading\n- OperationId-driven route binding on the server\n- OperationId-driven client invocation\n- Pydantic model-based request and response handling\n\nAll CRUD operations are exercised against an in-memory mock data store\nbacked by Pydantic domain models.\n\nThe tests assume:\n- OpenAPI-first route binding\n- Pydantic model validation\n- In-memory storage (no persistence guarantees)\n- Deterministic behavior in a single process", - "members": { - "TestClient": { - "name": "TestClient", - "kind": "alias", - "path": "openapi_first.templates.model_app.test_model_app.TestClient", - "signature": "", - "docstring": null - }, - "app": { - "name": "app", - "kind": "alias", - "path": "openapi_first.templates.model_app.test_model_app.app", - "signature": "", - "docstring": null - }, - "load_openapi": { - "name": "load_openapi", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.load_openapi", - "signature": "", - "docstring": "Load and validate an OpenAPI 3.x specification from disk.\n\nArgs:\n path (str | Path):\n Filesystem path to an OpenAPI specification file. Supported\n extensions: `.json`, `.yaml`, `.yml`.\n\nReturns:\n dict[str, Any]:\n Parsed and validated OpenAPI specification.\n\nRaises:\n OpenAPISpecLoadError:\n If the file does not exist, cannot be parsed, or fails OpenAPI\n schema validation.\n\nNotes:\n **Guarantees:**\n\n - The specification is parsed based on file extension and validated\n using a strict OpenAPI schema validator.\n - Any error results in an immediate exception, preventing\n application startup." - }, - "OpenAPIClient": { - "name": "OpenAPIClient", - "kind": "class", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient", - "signature": "", - "docstring": "OpenAPI-first HTTP client (`httpx`-based).\n\nNotes:\n **Responsibilities:**\n\n - This client derives all callable methods directly from an\n OpenAPI 3.x specification. Each `operationId` becomes a method\n on the client instance.\n\n **Guarantees:**\n\n - One callable per `operationId`.\n - Explicit parameters (path, query, headers, body).\n - No implicit schema inference or mutation.\n - Returns raw `httpx.Response` objects.\n - No response validation or deserialization.\n\nExample:\n ```python\n from openapi_first import loader, client\n\n spec = loader.load_openapi(\"openapi.yaml\")\n\n api = client.OpenAPIClient(\n spec=spec,\n base_url=\"http://localhost:8000\",\n )\n\n # Call operationId: getUser\n response = api.getUser(\n path_params={\"user_id\": 123}\n )\n\n print(response.status_code)\n print(response.json())\n ```", - "members": { - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.spec", - "signature": "", - "docstring": null - }, - "base_url": { - "name": "base_url", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.base_url", - "signature": "", - "docstring": null - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.client", - "signature": "", - "docstring": null - }, - "operations": { - "name": "operations", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.OpenAPIClient.operations", - "signature": "", - "docstring": null - } - } - }, - "client": { - "name": "client", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.client", - "signature": null, - "docstring": null - }, - "spec": { - "name": "spec", - "kind": "attribute", - "path": "openapi_first.templates.model_app.test_model_app.spec", - "signature": null, - "docstring": null - }, - "test_list_items_initial": { - "name": "test_list_items_initial", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_list_items_initial", - "signature": "", - "docstring": "Initial items should be present." - }, - "test_get_item": { - "name": "test_get_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_get_item", - "signature": "", - "docstring": "Existing item should be retrievable by ID." - }, - "test_create_item": { - "name": "test_create_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_create_item", - "signature": "", - "docstring": "Creating a new item should return the created entity." - }, - "test_update_item": { - "name": "test_update_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_update_item", - "signature": "", - "docstring": "Updating an item should replace its values." - }, - "test_delete_item": { - "name": "test_delete_item", - "kind": "function", - "path": "openapi_first.templates.model_app.test_model_app.test_delete_item", - "signature": "", - "docstring": "Deleting an item should remove it from the store." - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 95167d7..35a843c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -63,6 +63,7 @@ markdown_extensions: - pymdownx.tilde - pymdownx.mark site_name: openapi_first +docs_dir: docs/lib nav: - Home: index.md - Application Bootstrap: