Files
docs/libs/openapi-first/site/mcp/modules/openapi_first.codegen_routes.json
Vishesh 'ironeagle' Bangotra 0c25cbb19f feat: unify docs portal and MCP servers into one config-driven service
- add config.yml as single source of truth for collected repos/categories
- add collect.py CLI to pull lib/api/wiki site builds and mcp bundles from
  source repos and regenerate nginx.conf + _index/index.html
- port mcp runtime (main.py/core.py/config.py): nginx + health + FastMCP
  servers started from config.yml
- docker: python:3.13-slim + nginx, expose 8000-8006 + 9000 (html portal)
- drone: publish html (6007:9000) and MCP ports 8000-8006
- move mongo-ops docs to wiki/, add auth-server (api) and hexa (lib)
- refresh lib site builds (lib/ prefix) and collect mcp bundles
2026-09-11 15:14:51 +05:30

37 lines
3.6 KiB
JSON

{
"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": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
"docstring": null
},
"Any": {
"name": "Any",
"kind": "alias",
"path": "openapi_first.codegen_routes.Any",
"signature": "<bound method Alias.signature of Alias('Any', 'typing.Any')>",
"docstring": null
},
"load_openapi": {
"name": "load_openapi",
"kind": "function",
"path": "openapi_first.codegen_routes.load_openapi",
"signature": "<bound method Alias.signature of Alias('load_openapi', 'openapi_first.loader.load_openapi')>",
"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": "<bound method Function.signature of Function('generate_routes', 27, 102)>",
"docstring": "Generate route handler stubs from an OpenAPI specification.\n\nCreates one ``<resource>.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``."
}
}
}
}