openapi: 3.1.0 info: title: Items CRUD API version: 1.0.0 description: A simple API for managing items with CRUD operations. paths: /api/items: get: summary: Get all items operationId: getItems responses: '200': description: A list of items content: application/json: schema: type: array items: $ref: '#/components/schemas/Item' post: summary: Create an item operationId: createItem requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NewItem' responses: '201': description: Item created successfully content: application/json: schema: $ref: '#/components/schemas/Item' /api/items/{id}: get: summary: Get an item by ID operationId: getItemById parameters: - name: id in: path required: true schema: type: integer responses: '200': description: The requested item content: application/json: schema: $ref: '#/components/schemas/Item' '404': description: Item not found put: summary: Update an existing item operationId: updateItem parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/NewItem' responses: '200': description: Item updated successfully content: application/json: schema: $ref: '#/components/schemas/Item' '404': description: Item not found delete: summary: Delete an item operationId: deleteItem parameters: - name: id in: path required: true schema: type: integer responses: '204': description: Item deleted successfully '404': description: Item not found components: schemas: Item: type: object properties: id: type: integer example: 1 name: type: string example: Example Item required: - id - name NewItem: type: object properties: name: type: string example: Example Item required: - name