Files
openapi-first/docs/mcp/modules/openapi_first.templates.model_app.data.json
Vishesh 'ironeagle' Bangotra 51ffb4aae9 feat: codegen routes — sanitize resource names, --inject-request/--package, expand form bodies
codegen_routes.generate_routes now sanitizes resource identifiers (fetch-requests -> fetch_requests), optionally prepends 'request: Request' (inject_request) and emits <resource>/routes.py packages with __init__.py (package). multipart/form-data and x-www-form-urlencoded bodies expand to per-property UploadFile/File/Form params instead of an opaque dict; spec paths are normalized to forward slashes to avoid Windows escape issues. Adds CLI flags --inject-request/--package, 7 focused tests, and refreshes lib/wiki/MCP docs to the real CLI.
2026-10-13 03:26:31 +05:30

44 lines
3.1 KiB
JSON

{
"module": "openapi_first.templates.model_app.data",
"content": {
"path": "openapi_first.templates.model_app.data",
"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.",
"objects": {
"list_items": {
"name": "list_items",
"kind": "function",
"path": "openapi_first.templates.model_app.data.list_items",
"signature": "list_items() -> list[Item]",
"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": "get_item(item_id: int) -> Item",
"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": "create_item(payload: ItemCreate) -> Item",
"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": "update_item(item_id: int, payload: ItemCreate) -> Item",
"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": "delete_item(item_id: int) -> None",
"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."
}
}
}
}