{ "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": { "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." } } } }