{
  "openapi": "3.0.3",
  "info": {
    "title": "DefProd API",
    "version": "v1",
    "description": "\n# API Overview\n\nWelcome to the DefProd API documentation. This API provides programmatic access to DefProd's functionality through an HTTP RPC-style interface.\n\n## RPC URL\n\nAll API requests are POST requests made to the single RPC endpoint. The RPC endpoint URL is:\n\n```\nhttps://api.defprod.one/api/v1/rpc\n```\n\nAll requests must have the `Content-Type: application/json` header.  The RPC name and any input required are included in the JSON body.\n\n### Example: getUserStory RPC Call\n\nHere's a complete example of making an RPC call to retrieve a user story:\n\n**POST URL:**\n```\nhttps://api.defprod.one/api/v1/rpc\n```\n\n**Request Headers:**\n```\nContent-Type: application/json\nx-api-key: your-api-key-here\n```\n\n**Request Body:**\n```json\n{\n  \"name\": \"getUserStory\",\n  \"input\": {\n    \"userStoryId\": \"USERSTORY-1234\"\n  }\n}\n```\n\n### Comparison with REST API\n\nIn contrast to a traditional REST API approach, where you would use different HTTP methods and URL paths for different operations, the RPC-style API uses a single endpoint with the operation specified in the request body.\n\n**REST API approach (not used by DefProd):**\n```\nGET /api/v1/userStory/USERSTORY-1234\n```\n\n**DefProd RPC approach:**\n```\nPOST /api/v1/rpc\n```\n\n**Request Body:**\n```json\n{\n  \"name\": \"getUserStory\",\n  \"input\": {\n    \"userStoryId\": \"USERSTORY-1234\"\n  }\n}\n```\n\nThe RPC approach provides several advantages:\n- **Single endpoint**: All operations use the same URL, simplifying routing and firewall configuration\n- **Consistent structure**: All requests follow the same format with `name` and `input` fields\n- **Type safety**: The operation name is explicitly specified in the request body\n- **Extensibility**: New operations can be added without changing URL structures\n\n\n\n## Authentication\n\nAll authenticated RPC calls require an API key to be provided in the request headers.\n\n### API Key Authentication\n\nTo authenticate API requests, include your API key in the `x-api-key` header:\n\n```\nx-api-key: your-api-key-here\n```\n\n### Obtaining an API Key\n\nAPI keys can be created and managed through the user profile section of the application. Each user can create multiple API keys for different purposes.\n\n### Authorization Levels\n\nThe API supports two authorization levels:\n\n- **unauthenticated**: Endpoints that can be accessed without authentication\n- **user**: Endpoints that require a valid user API key\n\n### Security Best Practices\n\n- Keep your API keys secure and never commit them to version control\n- Rotate API keys regularly\n- Use different API keys for different applications or environments\n- Revoke API keys that are no longer needed\n\n\n\n## Request Structure\n\nAll API requests follow a consistent RPC (Remote Procedure Call) structure. Each request is a POST request to a specific endpoint, and the request body contains exactly two fields:\n\n1. **`name`**: A string literal that identifies which RPC operation to execute. This field must match exactly one of the available operation names (e.g., `\"deleteAgent\"`, `\"listArchitectures\"`, etc.).\n\n2. **`input`**: An object containing the parameters for the RPC operation. The structure of this object depends on the specific operation being called. Each operation defines its own input schema, which is documented in the request body schema for that RPC.\n\n### Example Request\n\n```json\n{\n  \"name\": \"listArchitectures\",\n  \"input\": {\n    \"page\": 1,\n    \"pageSize\": 10\n  }\n}\n```\n\nThe `name` field determines which RPC operation will be executed, and the `input` object provides the parameters for that operation.\nThe `name` field is required in every request body.\nSome operations may not require an `input` object, in which case the `input` object can be an empty object or left out altogether.\n\n\n\n## Response Format\n\nAll API responses follow a consistent wrapper format that includes metadata about the response and the actual data (if applicable).\n\n### Response Structure\n\nAll successful responses follow one of three formats:\n\n#### Single Data Response\n\nReturns a single object:\n\n```json\n{\n  \"meta\": {\n    \"dataCategory\": \"single\",\n    \"status\": 200,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"data\": {\n    // The actual data object\n  }\n}\n```\n\n#### List Data Response\n\nReturns an array of objects with pagination metadata:\n\n```json\n{\n  \"meta\": {\n    \"dataCategory\": \"list\",\n    \"status\": 200,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\",\n    \"filter\": {\n      // Applied filters (if any)\n    },\n    \"sort\": {\n      // Applied sorting (if any)\n    },\n    \"page\": {\n      \"number\": 1,\n      \"size\": 10\n    }\n  },\n  \"data\": [\n    // Array of data objects\n  ]\n}\n```\n\n#### No Data Response\n\nReturns only metadata (typically for command operations):\n\n```json\n{\n  \"meta\": {\n    \"dataCategory\": \"none\",\n    \"status\": 200,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  }\n}\n```\n\n### Response Metadata\n\nThe `meta` object contains:\n\n- **dataCategory**: The type of response (`\"single\"`, `\"list\"`, or `\"none\"`)\n- **status**: HTTP status code (typically 200 for success)\n- **timestamp**: ISO 8601 timestamp of when the response was generated\n- **filter** (list only): Applied filter criteria\n- **sort** (list only): Applied sort criteria\n- **page** (list only): Pagination information\n\n### Error Responses\n\nError responses follow a structured format with metadata and error details:\n\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 400,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"validationError\",\n    \"title\": \"Validation Error\",\n    \"detail\": \"The request data failed validation\"\n  }\n}\n```\n\nSee the Error Responses section for more details on error handling.\n\n\n\n## Error Responses\n\nWhen an API request fails, the response will include error information in a structured format.\n\n### Error Response Structure\n\nAll error responses follow a consistent structure with two main components:\n\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 400,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"error-type-identifier\",\n    \"title\": \"Human-readable error title\",\n    \"detail\": \"Detailed error message explaining what went wrong\"\n  }\n}\n```\n\n#### Meta Object\n\nThe `meta` object contains:\n- **error**: Always `true` for error responses\n- **status**: HTTP status code (400, 401, 403, 404, 500, etc.)\n- **timestamp**: ISO 8601 timestamp of when the error occurred\n\n#### Error Object\n\nThe `error` object contains:\n- **type**: Error type identifier (AppErrorType) for programmatic error handling\n- **title**: Human-readable error title\n- **detail**: Detailed error message explaining what went wrong\n\n### Common HTTP Status Codes\n\n- **200**: Success\n- **400**: Bad Request - The request was malformed or invalid\n- **401**: Unauthorized - Authentication required or invalid API key\n- **403**: Forbidden - Authenticated but not authorized for this operation\n- **404**: Not Found - The requested resource was not found\n- **500**: Internal Server Error - An unexpected error occurred on the server\n\n### Error Types\n\nThe `error.type` field contains a specific error type identifier (AppErrorType) that can be used for programmatic error handling. Common error types include:\n\n- `validationError`: The request data failed validation (400)\n- `unauthenticatedRequest`: Authentication is required or invalid API key (401)\n- `userNotAuthorized`: The user is not authorized for this operation (403)\n- `resourceNotFound`: The requested resource does not exist (404)\n- `userNotFound`: The user was not found (401)\n- `internalServerError`: An unexpected error occurred on the server (500)\n\n### Example Error Responses\n\n#### 400 Bad Request\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 400,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"validationError\",\n    \"title\": \"Bad Request\",\n    \"detail\": \"The request was malformed or invalid\"\n  }\n}\n```\n\n#### 401 Unauthorized\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 401,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"unauthenticatedRequest\",\n    \"title\": \"Unauthorized\",\n    \"detail\": \"Invalid or missing API key\"\n  }\n}\n```\n\n#### 403 Forbidden\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 403,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"userNotAuthorized\",\n    \"title\": \"Forbidden\",\n    \"detail\": \"Not authorized for this operation\"\n  }\n}\n```\n\n#### 404 Not Found\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 404,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"resourceNotFound\",\n    \"title\": \"Not Found\",\n    \"detail\": \"The requested resource was not found\"\n  }\n}\n```\n\n#### 500 Internal Server Error\n```json\n{\n  \"meta\": {\n    \"error\": true,\n    \"status\": 500,\n    \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n  },\n  \"error\": {\n    \"type\": \"internalServerError\",\n    \"title\": \"Internal Server Error\",\n    \"detail\": \"An unexpected error occurred on the server\"\n  }\n}\n```\n"
  },
  "servers": [
    {
      "url": "http://localhost:8200/api/v1",
      "description": "API Server"
    }
  ],
  "paths": {
    "/rpc/createArchitecture": {
      "post": {
        "operationId": "createArchitecture",
        "summary": "Create Architecture",
        "description": "Create a new architecture\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"createArchitecture\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "architectureId": {
                              "type": "string",
                              "description": "Architecture ID"
                            }
                          },
                          "required": [
                            "architectureId"
                          ],
                          "description": "Architecture selector"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "data": {
                    "architectureId": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "createArchitecture",
                    "description": "The RPC operation name. Must be exactly \"createArchitecture\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Architecture name"
                      },
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      },
                      "description": {
                        "type": "string",
                        "description": "Architecture description"
                      }
                    },
                    "required": [
                      "name",
                      "productId"
                    ],
                    "description": "Create architecture request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "createArchitecture",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "name": "System Architecture",
                  "description": "Main system architecture"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/createArchitectureElement": {
      "post": {
        "operationId": "createArchitectureElement",
        "summary": "Create Architecture Element",
        "description": "Create a new architecture element\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"createArchitectureElement\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "architectureId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "content": {
                              "type": "string"
                            },
                            "parentId": {
                              "type": "string"
                            },
                            "childrenIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "metadata": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "_id",
                            "architectureId",
                            "name",
                            "type"
                          ],
                          "description": "Output for creating an architecture element"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "data": {
                    "_id": "ARCHITECTURE_ELEMENT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "architectureId": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "name": "API Gateway",
                    "type": "component",
                    "content": "Main API gateway component",
                    "parentId": "ARCHITECTURE_ELEMENT-12345678-1234-1234-1234-123456789012",
                    "childrenIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.360Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "createArchitectureElement",
                    "description": "The RPC operation name. Must be exactly \"createArchitectureElement\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureId": {
                        "type": "string",
                        "description": "Architecture ID"
                      },
                      "name": {
                        "type": "string",
                        "description": "Architecture element name"
                      },
                      "content": {
                        "type": "string",
                        "description": "Architecture element content"
                      },
                      "type": {
                        "type": "string",
                        "description": "Architecture element type"
                      },
                      "parentId": {
                        "type": "string",
                        "description": "Parent architecture element ID"
                      }
                    },
                    "required": [
                      "architectureId",
                      "name",
                      "content",
                      "type",
                      "parentId"
                    ],
                    "description": "Create architecture element request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "createArchitectureElement",
                "input": {
                  "architectureId": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "name": "API Gateway",
                  "content": "Main API gateway component",
                  "type": "component",
                  "parentId": "ARCHITECTURE_ELEMENT-12345678-1234-1234-1234-123456789012"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/deleteArchitecture": {
      "post": {
        "operationId": "deleteArchitecture",
        "summary": "Delete Architecture",
        "description": "Delete an architecture\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"deleteArchitecture\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "deleteArchitecture",
                    "description": "The RPC operation name. Must be exactly \"deleteArchitecture\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureId": {
                        "type": "string",
                        "description": "Architecture ID"
                      }
                    },
                    "required": [
                      "architectureId"
                    ],
                    "description": "Architecture selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "deleteArchitecture",
                "input": {
                  "architectureId": "ARCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/deleteArchitectureElement": {
      "post": {
        "operationId": "deleteArchitectureElement",
        "summary": "Delete Architecture Element",
        "description": "Delete an architecture element\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"deleteArchitectureElement\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "deleteArchitectureElement",
                    "description": "The RPC operation name. Must be exactly \"deleteArchitectureElement\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureElementId": {
                        "type": "string",
                        "description": "Architecture element ID"
                      }
                    },
                    "required": [
                      "architectureElementId"
                    ],
                    "description": "Architecture element selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "deleteArchitectureElement",
                "input": {
                  "architectureElementId": "ARCHITECTURE_ELEMENT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getArchitecture": {
      "post": {
        "operationId": "getArchitecture",
        "summary": "Get Architecture",
        "description": "Get Architecture operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getArchitecture\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "metadata": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "_id",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "description": "Schema for getArchitectureOutput"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {
                    "_id": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "name": "System Architecture",
                    "description": "Main system architecture",
                    "createdAt": "2024-01-01T00:00:00Z",
                    "updatedAt": "2024-01-01T00:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getArchitecture",
                    "description": "The RPC operation name. Must be exactly \"getArchitecture\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureId": {
                        "type": "string",
                        "description": "Architecture ID"
                      }
                    },
                    "required": [
                      "architectureId"
                    ],
                    "description": "Architecture selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getArchitecture",
                "input": {
                  "architectureId": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getArchitectureElement": {
      "post": {
        "operationId": "getArchitectureElement",
        "summary": "Get Architecture Element",
        "description": "Get Architecture Element operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getArchitectureElement\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {
                    "_id": "ARCHELEM-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "architectureId": "ARCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "name": "API Gateway",
                    "type": "component",
                    "content": "Main API gateway component",
                    "parentId": null,
                    "childrenIds": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getArchitectureElement",
                    "description": "The RPC operation name. Must be exactly \"getArchitectureElement\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureElementId": {
                        "type": "string",
                        "description": "Architecture element ID"
                      }
                    },
                    "required": [
                      "architectureElementId"
                    ],
                    "description": "Architecture element selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getArchitectureElement",
                "input": {
                  "architectureElementId": "ARCHELEM-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getArchitectureForProduct": {
      "post": {
        "operationId": "getArchitectureForProduct",
        "summary": "Get Architecture For Product",
        "description": "Get the architecture for a product\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getArchitectureForProduct\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "metadata": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "_id",
                            "name",
                            "createdAt",
                            "updatedAt"
                          ],
                          "description": "Schema for getArchitectureForProductOutput"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {
                    "architecture": {
                      "_id": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "name": "System Architecture",
                      "description": "Main system architecture",
                      "createdAt": "2024-01-01T00:00:00Z",
                      "updatedAt": "2024-01-01T00:00:00Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getArchitectureForProduct",
                    "description": "The RPC operation name. Must be exactly \"getArchitectureForProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Product selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getArchitectureForProduct",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getArchitectureTree": {
      "post": {
        "operationId": "getArchitectureTree",
        "summary": "Get Architecture Tree",
        "description": "Get the architecture tree for an architecture\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getArchitectureTree\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "architectureId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "content": {
                              "type": "string"
                            },
                            "parentId": {
                              "type": "string"
                            },
                            "childrenIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "metadata": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "_id",
                            "architectureId",
                            "name",
                            "type"
                          ],
                          "description": "Schema for getArchitectureTreeOutput"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {
                    "_id": "ARCHELEM-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "architectureId": "ARCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "name": "Root Element",
                    "type": "component",
                    "content": "Root architecture element",
                    "parentId": null,
                    "children": [
                      {
                        "_id": "ARCHELEM-e152210e-9d1c-4f46-8b7f-2964161e1d06",
                        "architectureId": "ARCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                        "createdAt": "2025-06-02T08:34:06.140Z",
                        "name": "Frontend",
                        "parentId": "ARCHELEM-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                        "type": "frontend",
                        "updatedAt": "2025-06-04T00:57:33.349Z",
                        "content": "Our chief weapons are components!  Components and services... Our two weapons are components and services... and an almost fanatical devotion to RxJS Observables!  Our *three* weapons are..."
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getArchitectureTree",
                    "description": "The RPC operation name. Must be exactly \"getArchitectureTree\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureId": {
                        "type": "string",
                        "description": "Architecture ID"
                      }
                    },
                    "required": [
                      "architectureId"
                    ],
                    "description": "Architecture selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getArchitectureTree",
                "input": {
                  "architectureId": "ARCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listArchitectureElements": {
      "post": {
        "operationId": "listArchitectureElements",
        "summary": "List Architecture Elements",
        "description": "List Architecture Elements operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listArchitectureElements\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listArchitectureElements",
                    "description": "The RPC operation name. Must be exactly \"listArchitectureElements\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {},
                    "description": "Parameters for listing architecture elements"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listArchitectureElements",
                "input": {}
              }
            }
          }
        }
      }
    },
    "/rpc/listArchitectures": {
      "post": {
        "operationId": "listArchitectures",
        "summary": "List Architectures",
        "description": "List architectures\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listArchitectures\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": [
                    {
                      "_id": "ARCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "name": "System Architecture",
                      "description": "Main system architecture",
                      "createdAt": "2024-01-01T00:00:00Z",
                      "updatedAt": "2024-01-01T00:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listArchitectures",
                    "description": "The RPC operation name. Must be exactly \"listArchitectures\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "filter": {
                        "type": "string",
                        "description": "A database query filter (can be any MongoDB filter object)"
                      },
                      "sort": {
                        "type": "string",
                        "description": "A database query sort mapping field names to 1 (ascending) or -1 (descending)"
                      },
                      "page": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "number",
                            "description": "The page number (1-indexed)"
                          },
                          "size": {
                            "type": "number",
                            "description": "The number of items per page"
                          }
                        },
                        "required": [
                          "number",
                          "size"
                        ],
                        "description": "Pagination parameters for a database query"
                      }
                    },
                    "description": "Request parameters for retrieving a list of items with optional filtering, sorting, and pagination"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listArchitectures",
                "input": {
                  "page": 1,
                  "pageSize": 10
                }
              }
            }
          }
        }
      }
    },
    "/rpc/moveArchitectureElement": {
      "post": {
        "operationId": "moveArchitectureElement",
        "summary": "Move Architecture Element",
        "description": "Move an architecture element to a new parent and/or position\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"moveArchitectureElement\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {}
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "moveArchitectureElement",
                    "description": "The RPC operation name. Must be exactly \"moveArchitectureElement\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureElementId": {
                        "type": "string",
                        "description": "Architecture element ID to move"
                      },
                      "newParentId": {
                        "type": "string",
                        "description": "New parent ID (null for root, undefined to keep current parent)"
                      },
                      "order": {
                        "type": "number",
                        "description": "New order position (defaults to last sibling if not provided)"
                      }
                    },
                    "required": [
                      "architectureElementId"
                    ],
                    "description": "Parameters for moving an architecture element"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "moveArchitectureElement",
                "input": {
                  "architectureElementId": "ARCHELEM-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "newParentId": "ARCHELEM-12345678-1234-1234-1234-123456789012",
                  "order": 1
                }
              }
            }
          }
        }
      }
    },
    "/rpc/patchArchitectureElement": {
      "post": {
        "operationId": "patchArchitectureElement",
        "summary": "Patch Architecture Element",
        "description": "Apply patch changes to an architecture element\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"patchArchitectureElement\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "architectureElementId": {
                              "type": "string",
                              "description": "Architecture element ID"
                            },
                            "patch": {
                              "type": "array",
                              "description": "JSON Patch operations",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "op": {
                                    "type": "string",
                                    "description": "The operation type"
                                  },
                                  "path": {
                                    "type": "string",
                                    "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Value for add/replace operations"
                                  },
                                  "from": {
                                    "type": "string",
                                    "description": "Source path for move/copy operations"
                                  }
                                },
                                "required": [
                                  "op",
                                  "path"
                                ],
                                "description": "A single JSON Patch operation (RFC 6902)"
                              }
                            },
                            "patchId": {
                              "type": "string",
                              "description": "Patch ID"
                            }
                          },
                          "required": [
                            "architectureElementId",
                            "patch",
                            "patchId"
                          ],
                          "description": "Output for patching an architecture element"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {
                    "architectureElementId": "ARCHITECTURE_ELEMENT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "patch": [
                      {
                        "op": "replace",
                        "path": "/name",
                        "value": "Updated Element Name"
                      }
                    ],
                    "patchId": "PATCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "patchArchitectureElement",
                    "description": "The RPC operation name. Must be exactly \"patchArchitectureElement\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureElementId": {
                        "type": "string",
                        "description": "Architecture element ID"
                      },
                      "patch": {
                        "type": "array",
                        "description": "JSON Patch operations",
                        "items": {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "description": "The operation type"
                            },
                            "path": {
                              "type": "string",
                              "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                            },
                            "value": {
                              "type": "string",
                              "description": "Value for add/replace operations"
                            },
                            "from": {
                              "type": "string",
                              "description": "Source path for move/copy operations"
                            }
                          },
                          "required": [
                            "op",
                            "path"
                          ],
                          "description": "A single JSON Patch operation (RFC 6902)"
                        }
                      },
                      "comment": {
                        "type": "string",
                        "description": "Patch comment"
                      }
                    },
                    "required": [
                      "architectureElementId",
                      "patch"
                    ],
                    "description": "Parameters for patching an architecture element"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "patchArchitectureElement",
                "input": {
                  "architectureElementId": "ARCHITECTURE_ELEMENT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "patch": [
                    {
                      "op": "replace",
                      "path": "/name",
                      "value": "Updated Element Name"
                    }
                  ],
                  "comment": "Update element name"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/updateArchitecture": {
      "post": {
        "operationId": "updateArchitecture",
        "summary": "Update Architecture",
        "description": "Update Architecture operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"updateArchitecture\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "updateArchitecture",
                    "description": "The RPC operation name. Must be exactly \"updateArchitecture\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "architectureId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "metadata": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "architectureId"
                    ],
                    "description": "Schema for updateArchitectureInput"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "updateArchitecture",
                "input": {
                  "architectureId": "ARCHITECTURE-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "name": "Updated Architecture Name",
                  "description": "Updated description"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/updateArchitectureElement": {
      "post": {
        "operationId": "updateArchitectureElement",
        "summary": "Update Architecture Element",
        "description": "Update Architecture Element operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"updateArchitectureElement\"`.",
        "tags": [
          "architecture"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "updateArchitectureElement",
                    "description": "The RPC operation name. Must be exactly \"updateArchitectureElement\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {},
                    "description": "Parameters for updating an architecture element"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "updateArchitectureElement",
                "input": {}
              }
            }
          }
        }
      }
    },
    "/rpc/createArea": {
      "post": {
        "operationId": "createArea",
        "summary": "Create Product Area",
        "description": "Create a new product area\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"createArea\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "areaId": {
                              "type": "string",
                              "description": "Area ID"
                            }
                          },
                          "required": [
                            "areaId"
                          ],
                          "description": "Area selector"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "data": {
                    "areaId": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "createArea",
                    "description": "The RPC operation name. Must be exactly \"createArea\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the area"
                      },
                      "productId": {
                        "type": "string",
                        "description": "ID of the product this area belongs to"
                      },
                      "displayId": {
                        "type": "string",
                        "description": "Display identifier for the area"
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of the area (optional)"
                      },
                      "visibility": {
                        "type": "string",
                        "description": "Visibility of the area"
                      }
                    },
                    "required": [
                      "name",
                      "productId",
                      "displayId"
                    ],
                    "description": "Schema for createAreaInput"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "createArea",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "name": "User Management",
                  "description": "Area for managing users",
                  "displayId": "USER",
                  "order": 1
                }
              }
            }
          }
        }
      }
    },
    "/rpc/deleteArea": {
      "post": {
        "operationId": "deleteArea",
        "summary": "Delete Product Area",
        "description": "Delete a product area\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"deleteArea\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.361Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "deleteArea",
                    "description": "The RPC operation name. Must be exactly \"deleteArea\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "areaId": {
                        "type": "string",
                        "description": "Area ID"
                      }
                    },
                    "required": [
                      "areaId"
                    ],
                    "description": "Area selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "deleteArea",
                "input": {
                  "areaId": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getArea": {
      "post": {
        "operationId": "getArea",
        "summary": "Get Product Area",
        "description": "Get a product area\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getArea\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "displayId": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "productId": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "visibility": {
                              "type": "string"
                            },
                            "docs": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "tags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "order": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "_id",
                            "displayId",
                            "name",
                            "productId",
                            "createdAt",
                            "updatedAt"
                          ],
                          "description": "Schema for getAreaOutput"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "data": {
                    "_id": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "name": "User Management",
                    "description": "Area for managing users",
                    "displayId": "USER",
                    "order": 1,
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z",
                    "visibility": "public"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getArea",
                    "description": "The RPC operation name. Must be exactly \"getArea\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "areaId": {
                        "type": "string",
                        "description": "Area ID"
                      }
                    },
                    "required": [
                      "areaId"
                    ],
                    "description": "Area selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getArea",
                "input": {
                  "areaId": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listAllAreas": {
      "post": {
        "operationId": "listAllAreas",
        "summary": "List All Product Areas",
        "description": "List all product areas\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listAllAreas\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "data": [
                    {
                      "_id": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "name": "User Management",
                      "description": "Area for managing users",
                      "displayId": "USER",
                      "order": 1,
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "visibility": "public"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listAllAreas",
                    "description": "The RPC operation name. Must be exactly \"listAllAreas\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "filter": {
                        "type": "string",
                        "description": "A database query filter (can be any MongoDB filter object)"
                      },
                      "sort": {
                        "type": "string",
                        "description": "A database query sort mapping field names to 1 (ascending) or -1 (descending)"
                      },
                      "page": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "number",
                            "description": "The page number (1-indexed)"
                          },
                          "size": {
                            "type": "number",
                            "description": "The number of items per page"
                          }
                        },
                        "required": [
                          "number",
                          "size"
                        ],
                        "description": "Pagination parameters for a database query"
                      }
                    },
                    "description": "Request parameters for retrieving a list of items with optional filtering, sorting, and pagination"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listAllAreas",
                "input": {
                  "page": 1,
                  "pageSize": 10
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listAreas": {
      "post": {
        "operationId": "listAreas",
        "summary": "List Areas",
        "description": "List areas for a product\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listAreas\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ListCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "displayId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "productId": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "visibility": {
                                "type": "string"
                              },
                              "docs": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "tags": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "order": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "_id",
                              "displayId",
                              "name",
                              "productId",
                              "createdAt",
                              "updatedAt"
                            ]
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "data": [
                    {
                      "_id": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "name": "User Management",
                      "description": "Area for managing users",
                      "displayId": "USER",
                      "order": 1,
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z",
                      "visibility": "public"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listAreas",
                    "description": "The RPC operation name. Must be exactly \"listAreas\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Product selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listAreas",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/patchArea": {
      "post": {
        "operationId": "patchArea",
        "summary": "Patch Product Area",
        "description": "Apply patch changes to a product area\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"patchArea\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "areaId": {
                              "type": "string",
                              "description": "Area ID"
                            },
                            "patch": {
                              "type": "array",
                              "description": "JSON Patch operations",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "op": {
                                    "type": "string",
                                    "description": "The operation type"
                                  },
                                  "path": {
                                    "type": "string",
                                    "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Value for add/replace operations"
                                  },
                                  "from": {
                                    "type": "string",
                                    "description": "Source path for move/copy operations"
                                  }
                                },
                                "required": [
                                  "op",
                                  "path"
                                ],
                                "description": "A single JSON Patch operation (RFC 6902)"
                              }
                            },
                            "patchId": {
                              "type": "string",
                              "description": "Patch ID"
                            }
                          },
                          "required": [
                            "areaId",
                            "patch",
                            "patchId"
                          ],
                          "description": "Output for patching an area"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "data": {
                    "areaId": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "patch": [
                      {
                        "op": "replace",
                        "path": "/name",
                        "value": "Updated Area Name"
                      }
                    ],
                    "patchId": "PATCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "patchArea",
                    "description": "The RPC operation name. Must be exactly \"patchArea\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "areaId": {
                        "type": "string",
                        "description": "Area ID"
                      },
                      "patch": {
                        "type": "array",
                        "description": "JSON Patch operations",
                        "items": {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "description": "The operation type"
                            },
                            "path": {
                              "type": "string",
                              "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                            },
                            "value": {
                              "type": "string",
                              "description": "Value for add/replace operations"
                            },
                            "from": {
                              "type": "string",
                              "description": "Source path for move/copy operations"
                            }
                          },
                          "required": [
                            "op",
                            "path"
                          ],
                          "description": "A single JSON Patch operation (RFC 6902)"
                        }
                      },
                      "comment": {
                        "type": "string",
                        "description": "Patch comment"
                      }
                    },
                    "required": [
                      "areaId",
                      "patch"
                    ],
                    "description": "Parameters for patching an area"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "patchArea",
                "input": {
                  "areaId": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "patch": [
                    {
                      "op": "replace",
                      "path": "/name",
                      "value": "Updated Area Name"
                    }
                  ],
                  "comment": "Update area name"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/reorderAreas": {
      "post": {
        "operationId": "reorderAreas",
        "summary": "Reorder Product Areas",
        "description": "Atomically reorder areas within a product using a database transaction\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"reorderAreas\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.362Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "reorderAreas",
                    "description": "The RPC operation name. Must be exactly \"reorderAreas\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "ID of the product containing the areas to reorder"
                      },
                      "from": {
                        "type": "number",
                        "description": "The current position (0-based index) of the area to move"
                      },
                      "to": {
                        "type": "number",
                        "description": "The target position (0-based index) where the area should be moved to"
                      }
                    },
                    "required": [
                      "productId",
                      "from",
                      "to"
                    ],
                    "description": "Schema for reorderAreasInput"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "reorderAreas",
                "input": {
                  "productId": "PROD-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "from": 0,
                  "to": 2
                }
              }
            }
          }
        }
      }
    },
    "/rpc/updateArea": {
      "post": {
        "operationId": "updateArea",
        "summary": "Update Product Area",
        "description": "Update a product area\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"updateArea\"`.",
        "tags": [
          "area"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "updateArea",
                    "description": "The RPC operation name. Must be exactly \"updateArea\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "displayId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "metadata": {
                        "type": "string"
                      },
                      "order": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "_id",
                      "displayId"
                    ],
                    "description": "Schema for updateAreaInput"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "updateArea",
                "input": {
                  "_id": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "name": "Updated Area Name",
                  "description": "Updated description",
                  "displayId": "USER"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/createBrief": {
      "post": {
        "operationId": "createBrief",
        "summary": "Create Product Brief",
        "description": "Create a new product brief\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"createBrief\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "briefId": {
                              "type": "string",
                              "description": "Brief ID"
                            }
                          },
                          "required": [
                            "briefId"
                          ],
                          "description": "Brief selector"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": {
                    "briefId": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "createBrief",
                    "description": "The RPC operation name. Must be exactly \"createBrief\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      },
                      "description": {
                        "type": "string",
                        "description": "Brief description"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Create brief request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "createBrief",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "description": "A new product brief"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/deleteBrief": {
      "post": {
        "operationId": "deleteBrief",
        "summary": "Delete Product Brief",
        "description": "Delete a product brief\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"deleteBrief\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "deleteBrief",
                    "description": "The RPC operation name. Must be exactly \"deleteBrief\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "briefId": {
                        "type": "string",
                        "description": "Brief ID"
                      }
                    },
                    "required": [
                      "briefId"
                    ],
                    "description": "Brief selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "deleteBrief",
                "input": {
                  "briefId": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getBriefForProduct": {
      "post": {
        "operationId": "getBriefForProduct",
        "summary": "Get Brief For Product",
        "description": "Get the brief for a product\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getBriefForProduct\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string",
                              "description": "Brief ID"
                            },
                            "productId": {
                              "type": "string",
                              "description": "Product ID"
                            },
                            "description": {
                              "type": "string",
                              "description": "Brief description"
                            },
                            "userId": {
                              "type": "string",
                              "description": "User ID"
                            },
                            "problem": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "string"
                                },
                                "context": {
                                  "type": "string"
                                },
                                "impact": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "summary",
                                "context",
                                "impact"
                              ],
                              "description": "Problem definition"
                            },
                            "users": {
                              "type": "array",
                              "description": "User personas",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "persona": {
                                    "type": "string"
                                  },
                                  "goals": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "painPoints": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "persona",
                                  "goals",
                                  "painPoints"
                                ]
                              }
                            },
                            "requirements": {
                              "type": "array",
                              "description": "Requirements",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "priority": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "title",
                                  "description",
                                  "priority"
                                ]
                              }
                            },
                            "aesthetics": {
                              "type": "object",
                              "properties": {
                                "tone": {
                                  "type": "string"
                                },
                                "visualStyle": {
                                  "type": "string"
                                },
                                "interactionPrinciples": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "tone",
                                "visualStyle",
                                "interactionPrinciples"
                              ],
                              "description": "Aesthetics"
                            },
                            "successCriteria": {
                              "type": "array",
                              "description": "Success criteria",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outOfScope": {
                              "type": "array",
                              "description": "Out of scope items",
                              "items": {
                                "type": "string"
                              }
                            },
                            "references": {
                              "type": "array",
                              "description": "References",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string"
                                  },
                                  "url": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type"
                                ]
                              }
                            },
                            "version": {
                              "type": "string",
                              "description": "Version number"
                            },
                            "history": {
                              "type": "array",
                              "description": "Version history",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "version": {
                                    "type": "number"
                                  },
                                  "updatedAt": {
                                    "type": "string"
                                  },
                                  "changesSummary": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "updatedAt",
                                  "changesSummary"
                                ]
                              }
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Creation timestamp"
                            },
                            "updatedAt": {
                              "type": "string",
                              "description": "Last update timestamp"
                            }
                          },
                          "required": [
                            "_id",
                            "productId",
                            "description",
                            "userId",
                            "problem",
                            "users",
                            "requirements",
                            "aesthetics",
                            "successCriteria",
                            "outOfScope",
                            "references",
                            "version",
                            "history",
                            "createdAt",
                            "updatedAt"
                          ],
                          "description": "Brief"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": {
                    "_id": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "description": "A product brief",
                    "userId": "USER-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "problem": {
                      "statement": "Problem statement",
                      "context": "Problem context"
                    },
                    "users": [],
                    "requirements": [],
                    "aesthetics": {
                      "style": "modern",
                      "colorScheme": "blue"
                    },
                    "successCriteria": [],
                    "outOfScope": [],
                    "references": [],
                    "version": 1,
                    "history": [],
                    "createdAt": "2024-01-01T00:00:00Z",
                    "updatedAt": "2024-01-01T00:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getBriefForProduct",
                    "description": "The RPC operation name. Must be exactly \"getBriefForProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Product selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getBriefForProduct",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getBrief": {
      "post": {
        "operationId": "getBrief",
        "summary": "Get Product Brief",
        "description": "Get a product brief\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getBrief\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string",
                              "description": "Brief ID"
                            },
                            "productId": {
                              "type": "string",
                              "description": "Product ID"
                            },
                            "description": {
                              "type": "string",
                              "description": "Brief description"
                            },
                            "userId": {
                              "type": "string",
                              "description": "User ID"
                            },
                            "problem": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "string"
                                },
                                "context": {
                                  "type": "string"
                                },
                                "impact": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "summary",
                                "context",
                                "impact"
                              ],
                              "description": "Problem definition"
                            },
                            "users": {
                              "type": "array",
                              "description": "User personas",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "persona": {
                                    "type": "string"
                                  },
                                  "goals": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "painPoints": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "persona",
                                  "goals",
                                  "painPoints"
                                ]
                              }
                            },
                            "requirements": {
                              "type": "array",
                              "description": "Requirements",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "priority": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "title",
                                  "description",
                                  "priority"
                                ]
                              }
                            },
                            "aesthetics": {
                              "type": "object",
                              "properties": {
                                "tone": {
                                  "type": "string"
                                },
                                "visualStyle": {
                                  "type": "string"
                                },
                                "interactionPrinciples": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "tone",
                                "visualStyle",
                                "interactionPrinciples"
                              ],
                              "description": "Aesthetics"
                            },
                            "successCriteria": {
                              "type": "array",
                              "description": "Success criteria",
                              "items": {
                                "type": "string"
                              }
                            },
                            "outOfScope": {
                              "type": "array",
                              "description": "Out of scope items",
                              "items": {
                                "type": "string"
                              }
                            },
                            "references": {
                              "type": "array",
                              "description": "References",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string"
                                  },
                                  "url": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type"
                                ]
                              }
                            },
                            "version": {
                              "type": "string",
                              "description": "Version number"
                            },
                            "history": {
                              "type": "array",
                              "description": "Version history",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "version": {
                                    "type": "number"
                                  },
                                  "updatedAt": {
                                    "type": "string"
                                  },
                                  "changesSummary": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "version",
                                  "updatedAt",
                                  "changesSummary"
                                ]
                              }
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Creation timestamp"
                            },
                            "updatedAt": {
                              "type": "string",
                              "description": "Last update timestamp"
                            }
                          },
                          "required": [
                            "_id",
                            "productId",
                            "description",
                            "userId",
                            "problem",
                            "users",
                            "requirements",
                            "aesthetics",
                            "successCriteria",
                            "outOfScope",
                            "references",
                            "version",
                            "history",
                            "createdAt",
                            "updatedAt"
                          ],
                          "description": "Brief"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": {
                    "_id": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "description": "A product brief",
                    "userId": "USER-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "problem": {
                      "statement": "Problem statement",
                      "context": "Problem context"
                    },
                    "users": [],
                    "requirements": [],
                    "aesthetics": {
                      "style": "modern",
                      "colorScheme": "blue"
                    },
                    "successCriteria": [],
                    "outOfScope": [],
                    "references": [],
                    "version": 1,
                    "history": [],
                    "createdAt": "2024-01-01T00:00:00Z",
                    "updatedAt": "2024-01-01T00:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getBrief",
                    "description": "The RPC operation name. Must be exactly \"getBrief\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "briefId": {
                        "type": "string",
                        "description": "Brief ID"
                      }
                    },
                    "required": [
                      "briefId"
                    ],
                    "description": "Brief selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getBrief",
                "input": {
                  "briefId": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listBriefs": {
      "post": {
        "operationId": "listBriefs",
        "summary": "List All Product Briefs",
        "description": "List all product briefs\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listBriefs\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": [
                    {
                      "_id": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "description": "A product brief",
                      "userId": "USER-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "problem": {
                        "statement": "Problem statement",
                        "context": "Problem context"
                      },
                      "users": [],
                      "requirements": [],
                      "aesthetics": {
                        "style": "modern",
                        "colorScheme": "blue"
                      },
                      "successCriteria": [],
                      "outOfScope": [],
                      "references": [],
                      "version": 1,
                      "history": [],
                      "createdAt": "2024-01-01T00:00:00Z",
                      "updatedAt": "2024-01-01T00:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listBriefs",
                    "description": "The RPC operation name. Must be exactly \"listBriefs\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "filter": {
                        "type": "string",
                        "description": "A database query filter (can be any MongoDB filter object)"
                      },
                      "sort": {
                        "type": "string",
                        "description": "A database query sort mapping field names to 1 (ascending) or -1 (descending)"
                      },
                      "page": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "number",
                            "description": "The page number (1-indexed)"
                          },
                          "size": {
                            "type": "number",
                            "description": "The number of items per page"
                          }
                        },
                        "required": [
                          "number",
                          "size"
                        ],
                        "description": "Pagination parameters for a database query"
                      }
                    },
                    "description": "Request parameters for retrieving a list of items with optional filtering, sorting, and pagination"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listBriefs",
                "input": {
                  "page": 1,
                  "pageSize": 10
                }
              }
            }
          }
        }
      }
    },
    "/rpc/patchBrief": {
      "post": {
        "operationId": "patchBrief",
        "summary": "Patch Product Brief",
        "description": "Apply patch changes to a product brief\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"patchBrief\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "briefId": {
                              "type": "string",
                              "description": "Brief ID"
                            },
                            "patch": {
                              "type": "array",
                              "description": "JSON Patch operations",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "op": {
                                    "type": "string",
                                    "description": "The operation type"
                                  },
                                  "path": {
                                    "type": "string",
                                    "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Value for add/replace operations"
                                  },
                                  "from": {
                                    "type": "string",
                                    "description": "Source path for move/copy operations"
                                  }
                                },
                                "required": [
                                  "op",
                                  "path"
                                ],
                                "description": "A single JSON Patch operation (RFC 6902)"
                              }
                            },
                            "patchId": {
                              "type": "string",
                              "description": "Patch ID"
                            }
                          },
                          "required": [
                            "briefId",
                            "patch",
                            "patchId"
                          ],
                          "description": "Output for patching a brief"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": {
                    "briefId": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "patch": [
                      {
                        "op": "replace",
                        "path": "/description",
                        "value": "Updated brief description"
                      }
                    ],
                    "patchId": "PATCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "patchBrief",
                    "description": "The RPC operation name. Must be exactly \"patchBrief\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "briefId": {
                        "type": "string",
                        "description": "Brief ID"
                      },
                      "patch": {
                        "type": "array",
                        "description": "JSON Patch operations",
                        "items": {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "description": "The operation type"
                            },
                            "path": {
                              "type": "string",
                              "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                            },
                            "value": {
                              "type": "string",
                              "description": "Value for add/replace operations"
                            },
                            "from": {
                              "type": "string",
                              "description": "Source path for move/copy operations"
                            }
                          },
                          "required": [
                            "op",
                            "path"
                          ],
                          "description": "A single JSON Patch operation (RFC 6902)"
                        }
                      },
                      "comment": {
                        "type": "string",
                        "description": "Patch comment"
                      }
                    },
                    "required": [
                      "briefId",
                      "patch"
                    ],
                    "description": "Parameters for patching a brief"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "patchBrief",
                "input": {
                  "briefId": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "patch": [
                    {
                      "op": "replace",
                      "path": "/description",
                      "value": "Updated brief description"
                    }
                  ],
                  "comment": "Update brief description"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/updateBrief": {
      "post": {
        "operationId": "updateBrief",
        "summary": "Update Product Brief",
        "description": "Update a product brief\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"updateBrief\"`.",
        "tags": [
          "brief"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "updateBrief",
                    "description": "The RPC operation name. Must be exactly \"updateBrief\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Brief ID"
                      },
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      },
                      "description": {
                        "type": "string",
                        "description": "Brief description"
                      },
                      "userId": {
                        "type": "string",
                        "description": "User ID"
                      },
                      "createdAt": {
                        "type": "string",
                        "description": "Creation timestamp"
                      },
                      "updatedAt": {
                        "type": "string",
                        "description": "Last update timestamp"
                      },
                      "problem": {
                        "type": "object",
                        "properties": {
                          "summary": {
                            "type": "string"
                          },
                          "context": {
                            "type": "string"
                          },
                          "impact": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "summary",
                          "context",
                          "impact"
                        ]
                      },
                      "users": {
                        "type": "array",
                        "description": "User personas",
                        "items": {
                          "type": "object",
                          "properties": {
                            "persona": {
                              "type": "string"
                            },
                            "goals": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "painPoints": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "persona",
                            "goals",
                            "painPoints"
                          ]
                        }
                      },
                      "requirements": {
                        "type": "array",
                        "description": "Requirements",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "priority": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title",
                            "description",
                            "priority"
                          ]
                        }
                      },
                      "aesthetics": {
                        "type": "object",
                        "properties": {
                          "tone": {
                            "type": "string"
                          },
                          "visualStyle": {
                            "type": "string"
                          },
                          "interactionPrinciples": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "tone",
                          "visualStyle",
                          "interactionPrinciples"
                        ]
                      },
                      "successCriteria": {
                        "type": "array",
                        "description": "Success criteria",
                        "items": {
                          "type": "string"
                        }
                      },
                      "outOfScope": {
                        "type": "array",
                        "description": "Out of scope items",
                        "items": {
                          "type": "string"
                        }
                      },
                      "references": {
                        "type": "array",
                        "description": "References",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "type"
                          ]
                        }
                      },
                      "version": {
                        "type": "string",
                        "description": "Version number"
                      },
                      "history": {
                        "type": "array",
                        "description": "Version history",
                        "items": {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "number"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "changesSummary": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "version",
                            "updatedAt",
                            "changesSummary"
                          ]
                        }
                      }
                    },
                    "required": [
                      "_id"
                    ],
                    "description": "Update brief request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "updateBrief",
                "input": {
                  "_id": "BRIEF-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "description": "Updated brief description"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getApiInfo": {
      "post": {
        "operationId": "getApiInfo",
        "summary": "Get API Info",
        "description": "Get API Info operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getApiInfo\"`.",
        "tags": [
          "documentation"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "API name"
                            },
                            "version": {
                              "type": "string",
                              "description": "API version"
                            }
                          },
                          "required": [
                            "name",
                            "version"
                          ],
                          "description": "API information result"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": {
                    "name": "DefProd API",
                    "version": "1"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getApiInfo",
                    "description": "The RPC operation name. Must be exactly \"getApiInfo\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {},
                    "description": "Parameters for getting API information"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getApiInfo",
                "input": {}
              }
            }
          }
        }
      }
    },
    "/rpc/createProduct": {
      "post": {
        "operationId": "createProduct",
        "summary": "Create Product",
        "description": "Create a new product definition\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"createProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "productId": {
                              "type": "string",
                              "description": "Product ID"
                            }
                          },
                          "required": [
                            "productId"
                          ],
                          "description": "Product selector"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "data": {
                    "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.363Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "createProduct",
                    "description": "The RPC operation name. Must be exactly \"createProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Product name"
                      },
                      "description": {
                        "type": "string",
                        "description": "Product description"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "description": "Create product request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "createProduct",
                "input": {
                  "name": "My New Product",
                  "description": "A sample product description"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/deleteProduct": {
      "post": {
        "operationId": "deleteProduct",
        "summary": "Delete Product",
        "description": "Delete a product definition\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"deleteProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "deleteProduct",
                    "description": "The RPC operation name. Must be exactly \"deleteProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Product selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "deleteProduct",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/exportProduct": {
      "post": {
        "operationId": "exportProduct",
        "summary": "Export Product",
        "description": "Export a product and all associated data as JSON\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"exportProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "product": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "description": "Product name"
                                },
                                "_id": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "Product description"
                                }
                              },
                              "required": [
                                "name",
                                "_id"
                              ],
                              "description": "Product template item"
                            },
                            "brief": {
                              "type": "object",
                              "properties": {
                                "productId": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "_id": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "problem": {
                                  "type": "object",
                                  "properties": {
                                    "summary": {
                                      "type": "string"
                                    },
                                    "context": {
                                      "type": "string"
                                    },
                                    "impact": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "summary",
                                    "context",
                                    "impact"
                                  ]
                                },
                                "users": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "persona": {
                                        "type": "string"
                                      },
                                      "goals": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "painPoints": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "persona",
                                      "goals",
                                      "painPoints"
                                    ]
                                  }
                                },
                                "requirements": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "priority": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "title",
                                      "description",
                                      "priority"
                                    ]
                                  }
                                },
                                "aesthetics": {
                                  "type": "object",
                                  "properties": {
                                    "tone": {
                                      "type": "string"
                                    },
                                    "visualStyle": {
                                      "type": "string"
                                    },
                                    "interactionPrinciples": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "tone",
                                    "visualStyle",
                                    "interactionPrinciples"
                                  ]
                                },
                                "successCriteria": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "outOfScope": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "references": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  }
                                },
                                "version": {
                                  "type": "string"
                                },
                                "history": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "version": {
                                        "type": "number"
                                      },
                                      "updatedAt": {
                                        "type": "string"
                                      },
                                      "changesSummary": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "updatedAt",
                                      "changesSummary"
                                    ]
                                  }
                                },
                                "description": {
                                  "type": "string",
                                  "description": "Brief description"
                                }
                              },
                              "required": [
                                "productId",
                                "_id",
                                "problem",
                                "users",
                                "requirements",
                                "aesthetics",
                                "successCriteria",
                                "outOfScope",
                                "references",
                                "version",
                                "history"
                              ],
                              "description": "Brief template item"
                            },
                            "areas": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string",
                                    "description": "The name of the area"
                                  },
                                  "productId": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "displayId": {
                                    "type": "string",
                                    "description": "Display identifier for the area"
                                  },
                                  "_id": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "description": {
                                    "type": "string",
                                    "description": "Description of the area (optional)"
                                  },
                                  "visibility": {
                                    "type": "string",
                                    "description": "Visibility of the area"
                                  },
                                  "docs": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "tags": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "order": {
                                    "type": "number"
                                  }
                                },
                                "required": [
                                  "name",
                                  "productId",
                                  "displayId",
                                  "_id"
                                ],
                                "description": "Area template item"
                              }
                            },
                            "userStories": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "title": {
                                    "type": "string",
                                    "description": "User story title"
                                  },
                                  "displayId": {
                                    "type": "string",
                                    "description": "User story display ID"
                                  },
                                  "productId": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "acceptanceCriteria": {
                                    "type": "array",
                                    "description": "User story acceptance criteria",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "_id": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "description": {
                                    "type": "string",
                                    "description": "User story description"
                                  },
                                  "areaId": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "status": {
                                    "type": "string"
                                  },
                                  "priority": {
                                    "type": "string"
                                  },
                                  "storyPoints": {
                                    "type": "number"
                                  },
                                  "tags": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "metadata": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "title",
                                  "displayId",
                                  "productId",
                                  "acceptanceCriteria",
                                  "_id"
                                ],
                                "description": "User story template item"
                              }
                            },
                            "architecture": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "description": "Architecture name"
                                },
                                "productId": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "_id": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "Architecture description"
                                },
                                "metadata": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "productId",
                                "_id"
                              ],
                              "description": "Architecture template item"
                            },
                            "architectureElements": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "architectureId": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Architecture element name"
                                  },
                                  "type": {
                                    "type": "string",
                                    "description": "Architecture element type"
                                  },
                                  "_id": {
                                    "type": "string",
                                    "description": "Template ID in format PREFIX:NUMBER"
                                  },
                                  "content": {
                                    "type": "string"
                                  },
                                  "parentId": {
                                    "type": "string"
                                  },
                                  "childrenIds": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "description": "Template ID in format PREFIX:NUMBER"
                                    }
                                  },
                                  "metadata": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "architectureId",
                                  "name",
                                  "type",
                                  "_id"
                                ],
                                "description": "Architecture element template item"
                              }
                            },
                            "genaiSession": {
                              "type": "object",
                              "properties": {
                                "_id": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "provider": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "modelName": {
                                  "type": "string"
                                },
                                "history": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "productId": {
                                  "type": "string",
                                  "description": "Template ID in format PREFIX:NUMBER"
                                },
                                "agentType": {
                                  "type": "string"
                                },
                                "contextType": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "_id",
                                "provider"
                              ],
                              "description": "GenAI session template item"
                            }
                          },
                          "required": [
                            "_id",
                            "product",
                            "brief",
                            "areas",
                            "userStories",
                            "architecture",
                            "architectureElements",
                            "genaiSession"
                          ],
                          "description": "Product template"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "data": {
                    "_id": "PRODUCT:1",
                    "product": {
                      "_id": "PRODUCT:1",
                      "name": "My Product",
                      "description": "A sample product description"
                    },
                    "brief": {
                      "_id": "BRIEF:1",
                      "productId": "PRODUCT:1",
                      "description": "Product brief description"
                    },
                    "areas": [],
                    "userStories": [],
                    "architecture": null,
                    "architectureElements": [],
                    "genaiSession": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "exportProduct",
                    "description": "The RPC operation name. Must be exactly \"exportProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Product selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "exportProduct",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getProduct": {
      "post": {
        "operationId": "getProduct",
        "summary": "Get Product",
        "description": "Get a product definition\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string",
                              "description": "Product ID"
                            },
                            "name": {
                              "type": "string",
                              "description": "Product name"
                            },
                            "createdAt": {
                              "type": "string",
                              "description": "Creation timestamp"
                            },
                            "updatedAt": {
                              "type": "string",
                              "description": "Last update timestamp"
                            },
                            "userId": {
                              "type": "string",
                              "description": "User ID"
                            },
                            "description": {
                              "type": "string",
                              "description": "Product description"
                            },
                            "status": {
                              "type": "string",
                              "description": "Product status"
                            },
                            "lastActivityAt": {
                              "type": "string",
                              "description": "Last activity timestamp"
                            },
                            "brief": {
                              "type": "object",
                              "properties": {
                                "_id": {
                                  "type": "string",
                                  "description": "Brief ID"
                                },
                                "productId": {
                                  "type": "string",
                                  "description": "Product ID"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "Brief description"
                                },
                                "userId": {
                                  "type": "string",
                                  "description": "User ID"
                                },
                                "problem": {
                                  "type": "object",
                                  "properties": {
                                    "summary": {
                                      "type": "string"
                                    },
                                    "context": {
                                      "type": "string"
                                    },
                                    "impact": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "summary",
                                    "context",
                                    "impact"
                                  ],
                                  "description": "Problem definition"
                                },
                                "users": {
                                  "type": "array",
                                  "description": "User personas",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "persona": {
                                        "type": "string"
                                      },
                                      "goals": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "painPoints": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "persona",
                                      "goals",
                                      "painPoints"
                                    ]
                                  }
                                },
                                "requirements": {
                                  "type": "array",
                                  "description": "Requirements",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      },
                                      "priority": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "title",
                                      "description",
                                      "priority"
                                    ]
                                  }
                                },
                                "aesthetics": {
                                  "type": "object",
                                  "properties": {
                                    "tone": {
                                      "type": "string"
                                    },
                                    "visualStyle": {
                                      "type": "string"
                                    },
                                    "interactionPrinciples": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "required": [
                                    "tone",
                                    "visualStyle",
                                    "interactionPrinciples"
                                  ],
                                  "description": "Aesthetics"
                                },
                                "successCriteria": {
                                  "type": "array",
                                  "description": "Success criteria",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "outOfScope": {
                                  "type": "array",
                                  "description": "Out of scope items",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "references": {
                                  "type": "array",
                                  "description": "References",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "description": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  }
                                },
                                "version": {
                                  "type": "string",
                                  "description": "Version number"
                                },
                                "history": {
                                  "type": "array",
                                  "description": "Version history",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "version": {
                                        "type": "number"
                                      },
                                      "updatedAt": {
                                        "type": "string"
                                      },
                                      "changesSummary": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "version",
                                      "updatedAt",
                                      "changesSummary"
                                    ]
                                  }
                                },
                                "createdAt": {
                                  "type": "string",
                                  "description": "Creation timestamp"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "description": "Last update timestamp"
                                }
                              },
                              "required": [
                                "_id",
                                "productId",
                                "description",
                                "userId",
                                "problem",
                                "users",
                                "requirements",
                                "aesthetics",
                                "successCriteria",
                                "outOfScope",
                                "references",
                                "version",
                                "history",
                                "createdAt",
                                "updatedAt"
                              ],
                              "description": "Brief"
                            }
                          },
                          "required": [
                            "_id",
                            "name",
                            "createdAt",
                            "updatedAt",
                            "userId"
                          ],
                          "description": "Product view"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "data": {
                    "_id": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "name": "My Product",
                    "description": "A sample product",
                    "userId": "USER-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "createdAt": "2024-01-01T00:00:00Z",
                    "updatedAt": "2024-01-01T00:00:00Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getProduct",
                    "description": "The RPC operation name. Must be exactly \"getProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Product selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getProduct",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/importProduct": {
      "post": {
        "operationId": "importProduct",
        "summary": "Import Product",
        "description": "Import a product and all associated data from exported JSON\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"importProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "productId": {
                              "type": "string",
                              "description": "Product ID"
                            }
                          },
                          "required": [
                            "productId"
                          ],
                          "description": "Product selector"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "data": {
                    "productId": "PRODUCT-new-id"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "importProduct",
                    "description": "The RPC operation name. Must be exactly \"importProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Template ID in format PREFIX:NUMBER"
                      },
                      "product": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Product name"
                          },
                          "_id": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "description": {
                            "type": "string",
                            "description": "Product description"
                          }
                        },
                        "required": [
                          "name",
                          "_id"
                        ],
                        "description": "Product template item"
                      },
                      "brief": {
                        "type": "object",
                        "properties": {
                          "productId": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "_id": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "problem": {
                            "type": "object",
                            "properties": {
                              "summary": {
                                "type": "string"
                              },
                              "context": {
                                "type": "string"
                              },
                              "impact": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "summary",
                              "context",
                              "impact"
                            ]
                          },
                          "users": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "persona": {
                                  "type": "string"
                                },
                                "goals": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "painPoints": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "persona",
                                "goals",
                                "painPoints"
                              ]
                            }
                          },
                          "requirements": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                },
                                "priority": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "title",
                                "description",
                                "priority"
                              ]
                            }
                          },
                          "aesthetics": {
                            "type": "object",
                            "properties": {
                              "tone": {
                                "type": "string"
                              },
                              "visualStyle": {
                                "type": "string"
                              },
                              "interactionPrinciples": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "tone",
                              "visualStyle",
                              "interactionPrinciples"
                            ]
                          },
                          "successCriteria": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "outOfScope": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "references": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          },
                          "version": {
                            "type": "string"
                          },
                          "history": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "version": {
                                  "type": "number"
                                },
                                "updatedAt": {
                                  "type": "string"
                                },
                                "changesSummary": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "version",
                                "updatedAt",
                                "changesSummary"
                              ]
                            }
                          },
                          "description": {
                            "type": "string",
                            "description": "Brief description"
                          }
                        },
                        "required": [
                          "productId",
                          "_id",
                          "problem",
                          "users",
                          "requirements",
                          "aesthetics",
                          "successCriteria",
                          "outOfScope",
                          "references",
                          "version",
                          "history"
                        ],
                        "description": "Brief template item"
                      },
                      "areas": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The name of the area"
                            },
                            "productId": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "displayId": {
                              "type": "string",
                              "description": "Display identifier for the area"
                            },
                            "_id": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "description": {
                              "type": "string",
                              "description": "Description of the area (optional)"
                            },
                            "visibility": {
                              "type": "string",
                              "description": "Visibility of the area"
                            },
                            "docs": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "tags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "order": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "name",
                            "productId",
                            "displayId",
                            "_id"
                          ],
                          "description": "Area template item"
                        }
                      },
                      "userStories": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string",
                              "description": "User story title"
                            },
                            "displayId": {
                              "type": "string",
                              "description": "User story display ID"
                            },
                            "productId": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "acceptanceCriteria": {
                              "type": "array",
                              "description": "User story acceptance criteria",
                              "items": {
                                "type": "string"
                              }
                            },
                            "_id": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "description": {
                              "type": "string",
                              "description": "User story description"
                            },
                            "areaId": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "status": {
                              "type": "string"
                            },
                            "priority": {
                              "type": "string"
                            },
                            "storyPoints": {
                              "type": "number"
                            },
                            "tags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "metadata": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "title",
                            "displayId",
                            "productId",
                            "acceptanceCriteria",
                            "_id"
                          ],
                          "description": "User story template item"
                        }
                      },
                      "architecture": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Architecture name"
                          },
                          "productId": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "_id": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "description": {
                            "type": "string",
                            "description": "Architecture description"
                          },
                          "metadata": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "productId",
                          "_id"
                        ],
                        "description": "Architecture template item"
                      },
                      "architectureElements": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "architectureId": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "name": {
                              "type": "string",
                              "description": "Architecture element name"
                            },
                            "type": {
                              "type": "string",
                              "description": "Architecture element type"
                            },
                            "_id": {
                              "type": "string",
                              "description": "Template ID in format PREFIX:NUMBER"
                            },
                            "content": {
                              "type": "string"
                            },
                            "parentId": {
                              "type": "string"
                            },
                            "childrenIds": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "description": "Template ID in format PREFIX:NUMBER"
                              }
                            },
                            "metadata": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "architectureId",
                            "name",
                            "type",
                            "_id"
                          ],
                          "description": "Architecture element template item"
                        }
                      },
                      "genaiSession": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "modelName": {
                            "type": "string"
                          },
                          "history": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "productId": {
                            "type": "string",
                            "description": "Template ID in format PREFIX:NUMBER"
                          },
                          "agentType": {
                            "type": "string"
                          },
                          "contextType": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "_id",
                          "provider"
                        ],
                        "description": "GenAI session template item"
                      }
                    },
                    "required": [
                      "_id",
                      "product",
                      "brief",
                      "areas",
                      "userStories",
                      "architecture",
                      "architectureElements",
                      "genaiSession"
                    ],
                    "description": "Product data to import"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "importProduct",
                "input": {
                  "product": {
                    "_id": "PRODUCT-old-id",
                    "name": "My Product",
                    "userId": "USER-old-id",
                    "createdAt": "2024-01-01T00:00:00Z",
                    "updatedAt": "2024-01-01T00:00:00Z"
                  },
                  "brief": null,
                  "area": [],
                  "userStory": [],
                  "architecture": null,
                  "architectureElement": [],
                  "genaiSession": null
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listProductSummaries": {
      "post": {
        "operationId": "listProductSummaries",
        "summary": "List Product Summaries",
        "description": "List Product Summaries operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listProductSummaries\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "data": [
                    {
                      "_id": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "name": "My Product",
                      "description": "A sample product",
                      "userId": "USER-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "createdAt": "2024-01-01T00:00:00Z",
                      "updatedAt": "2024-01-01T00:00:00Z",
                      "progressPercent": 75,
                      "briefStatus": "complete",
                      "userStoriesCount": 10,
                      "userStoriesTotal": 15,
                      "areasCount": 3,
                      "architectureStatus": "partial",
                      "lastActivityAt": "2024-01-15T00:00:00Z",
                      "recentActivity": "Updated user stories"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listProducts": {
      "post": {
        "operationId": "listProducts",
        "summary": "List Products",
        "description": "List all product definitions\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listProducts\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ListCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string",
                                "description": "Product ID"
                              },
                              "name": {
                                "type": "string",
                                "description": "Product name"
                              },
                              "createdAt": {
                                "type": "string",
                                "description": "Creation timestamp"
                              },
                              "updatedAt": {
                                "type": "string",
                                "description": "Last update timestamp"
                              },
                              "userId": {
                                "type": "string",
                                "description": "User ID"
                              },
                              "description": {
                                "type": "string",
                                "description": "Product description"
                              },
                              "status": {
                                "type": "string",
                                "description": "Product status"
                              },
                              "lastActivityAt": {
                                "type": "string",
                                "description": "Last activity timestamp"
                              }
                            },
                            "required": [
                              "_id",
                              "name",
                              "createdAt",
                              "updatedAt",
                              "userId"
                            ],
                            "description": "Product"
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "data": [
                    {
                      "_id": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "name": "My Product",
                      "description": "A sample product",
                      "userId": "USER-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "createdAt": "2024-01-01T00:00:00Z",
                      "updatedAt": "2024-01-01T00:00:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.364Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listProducts",
                    "description": "The RPC operation name. Must be exactly \"listProducts\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "filter": {
                        "type": "string",
                        "description": "A database query filter (can be any MongoDB filter object)"
                      },
                      "sort": {
                        "type": "string",
                        "description": "A database query sort mapping field names to 1 (ascending) or -1 (descending)"
                      },
                      "page": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "number",
                            "description": "The page number (1-indexed)"
                          },
                          "size": {
                            "type": "number",
                            "description": "The number of items per page"
                          }
                        },
                        "required": [
                          "number",
                          "size"
                        ],
                        "description": "Pagination parameters for a database query"
                      }
                    },
                    "description": "Request parameters for retrieving a list of items with optional filtering, sorting, and pagination"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listProducts",
                "input": {
                  "page": 1,
                  "pageSize": 10
                }
              }
            }
          }
        }
      }
    },
    "/rpc/patchProduct": {
      "post": {
        "operationId": "patchProduct",
        "summary": "Patch Product",
        "description": "Apply patch changes to a product definition\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"patchProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "productId": {
                              "type": "string",
                              "description": "Product ID"
                            },
                            "patch": {
                              "type": "array",
                              "description": "JSON Patch operations",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "op": {
                                    "type": "string",
                                    "description": "The operation type"
                                  },
                                  "path": {
                                    "type": "string",
                                    "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Value for add/replace operations"
                                  },
                                  "from": {
                                    "type": "string",
                                    "description": "Source path for move/copy operations"
                                  }
                                },
                                "required": [
                                  "op",
                                  "path"
                                ],
                                "description": "A single JSON Patch operation (RFC 6902)"
                              }
                            },
                            "patchId": {
                              "type": "string",
                              "description": "Patch ID"
                            }
                          },
                          "required": [
                            "productId",
                            "patch",
                            "patchId"
                          ],
                          "description": "Output for patching a product"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "data": {
                    "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "patch": [
                      {
                        "op": "replace",
                        "path": "/name",
                        "value": "Updated Product Name"
                      }
                    ],
                    "patchId": "PATCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "patchProduct",
                    "description": "The RPC operation name. Must be exactly \"patchProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      },
                      "patch": {
                        "type": "array",
                        "description": "JSON Patch operations",
                        "items": {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "description": "The operation type"
                            },
                            "path": {
                              "type": "string",
                              "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                            },
                            "value": {
                              "type": "string",
                              "description": "Value for add/replace operations"
                            },
                            "from": {
                              "type": "string",
                              "description": "Source path for move/copy operations"
                            }
                          },
                          "required": [
                            "op",
                            "path"
                          ],
                          "description": "A single JSON Patch operation (RFC 6902)"
                        }
                      },
                      "comment": {
                        "type": "string",
                        "description": "Patch comment"
                      }
                    },
                    "required": [
                      "productId",
                      "patch"
                    ],
                    "description": "Parameters for patching a product"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "patchProduct",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "patch": [
                    {
                      "op": "replace",
                      "path": "/name",
                      "value": "Updated Product Name"
                    }
                  ],
                  "comment": "Update product name"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/updateProduct": {
      "post": {
        "operationId": "updateProduct",
        "summary": "Update Product",
        "description": "Update Product operation\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"updateProduct\"`.",
        "tags": [
          "product"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "updateProduct",
                    "description": "The RPC operation name. Must be exactly \"updateProduct\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string",
                        "description": "Product ID"
                      },
                      "name": {
                        "type": "string",
                        "description": "Product name"
                      },
                      "status": {
                        "type": "string",
                        "description": "Product status"
                      }
                    },
                    "required": [
                      "_id"
                    ],
                    "description": "Update product request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "updateProduct",
                "input": {
                  "_id": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "name": "Updated Product Name",
                  "status": "active"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/createUserStory": {
      "post": {
        "operationId": "createUserStory",
        "summary": "Create User Story",
        "description": "Create a new user story\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"createUserStory\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "userStoryId": {
                              "type": "string",
                              "description": "User story ID"
                            }
                          },
                          "required": [
                            "userStoryId"
                          ],
                          "description": "User story selector"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "data": {
                    "userStoryId": "USER_STORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "createUserStory",
                    "description": "The RPC operation name. Must be exactly \"createUserStory\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "User story title"
                      },
                      "displayId": {
                        "type": "string",
                        "description": "User story display ID"
                      },
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      },
                      "status": {
                        "type": "string",
                        "description": "User story status"
                      },
                      "priority": {
                        "type": "string",
                        "description": "User story priority"
                      },
                      "acceptanceCriteria": {
                        "type": "array",
                        "description": "User story acceptance criteria",
                        "items": {
                          "type": "string"
                        }
                      },
                      "description": {
                        "type": "string",
                        "description": "User story description"
                      },
                      "areaId": {
                        "type": "string",
                        "description": "Area ID"
                      }
                    },
                    "required": [
                      "title",
                      "displayId",
                      "productId",
                      "status",
                      "priority",
                      "acceptanceCriteria"
                    ],
                    "description": "Create user story request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "createUserStory",
                "input": {
                  "title": "User Story Title",
                  "description": "User story description",
                  "displayId": "US-001",
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "status": "todo",
                  "priority": "medium",
                  "acceptanceCriteria": [
                    "Criterion 1",
                    "Criterion 2"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/rpc/deleteUserStory": {
      "post": {
        "operationId": "deleteUserStory",
        "summary": "Delete User Story",
        "description": "Delete a user story\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"deleteUserStory\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "deleteUserStory",
                    "description": "The RPC operation name. Must be exactly \"deleteUserStory\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "userStoryId": {
                        "type": "string",
                        "description": "User story ID"
                      }
                    },
                    "required": [
                      "userStoryId"
                    ],
                    "description": "User story selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "deleteUserStory",
                "input": {
                  "userStoryId": "USERSTORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/getUserStory": {
      "post": {
        "operationId": "getUserStory",
        "summary": "Get User Story",
        "description": "Get a user story\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"getUserStory\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            },
                            "displayId": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string",
                              "description": "Format: As a [role], I want [action] so that [benefit]"
                            },
                            "acceptanceCriteria": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "priority": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "storyPoints": {
                              "type": "number"
                            },
                            "assigneeId": {
                              "type": "string"
                            },
                            "areaId": {
                              "type": "string"
                            },
                            "tags": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "metadata": {
                              "type": "string"
                            },
                            "order": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "_id",
                            "title",
                            "createdAt",
                            "updatedAt",
                            "displayId"
                          ],
                          "description": "Schema for getUserStoryOutput"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "data": {
                    "_id": "USERSTORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "title": "User can log in",
                    "description": "As a user, I want to log in so that I can access my account",
                    "priority": "high",
                    "status": "todo",
                    "storyPoints": 5,
                    "displayId": "US-001",
                    "createdAt": "2024-01-01T00:00:00.000Z",
                    "updatedAt": "2024-01-01T00:00:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "getUserStory",
                    "description": "The RPC operation name. Must be exactly \"getUserStory\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "userStoryId": {
                        "type": "string",
                        "description": "User story ID"
                      }
                    },
                    "required": [
                      "userStoryId"
                    ],
                    "description": "User story selector"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "getUserStory",
                "input": {
                  "userStoryId": "USERSTORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listAllUserStories": {
      "post": {
        "operationId": "listAllUserStories",
        "summary": "List All User Stories",
        "description": "List all user stories\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listAllUserStories\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListCaseResponse"
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "data": [
                    {
                      "_id": "STORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "title": "User can log in",
                      "description": "As a user, I want to log in so that I can access my account",
                      "priority": "high",
                      "status": "todo",
                      "storyPoints": 5,
                      "displayId": "US-001",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listAllUserStories",
                    "description": "The RPC operation name. Must be exactly \"listAllUserStories\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "filter": {
                        "type": "string",
                        "description": "A database query filter (can be any MongoDB filter object)"
                      },
                      "sort": {
                        "type": "string",
                        "description": "A database query sort mapping field names to 1 (ascending) or -1 (descending)"
                      },
                      "page": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "number",
                            "description": "The page number (1-indexed)"
                          },
                          "size": {
                            "type": "number",
                            "description": "The number of items per page"
                          }
                        },
                        "required": [
                          "number",
                          "size"
                        ],
                        "description": "Pagination parameters for a database query"
                      }
                    },
                    "description": "Request parameters for retrieving a list of items with optional filtering, sorting, and pagination"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listAllUserStories",
                "input": {
                  "page": 1,
                  "pageSize": 10
                }
              }
            }
          }
        }
      }
    },
    "/rpc/listUserStories": {
      "post": {
        "operationId": "listUserStories",
        "summary": "List User Stories",
        "description": "List user stories for a product\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"listUserStories\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ListCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string"
                              },
                              "displayId": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string",
                                "description": "Format: As a [role], I want [action] so that [benefit]"
                              },
                              "acceptanceCriteria": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "priority": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "storyPoints": {
                                "type": "number"
                              },
                              "assigneeId": {
                                "type": "string"
                              },
                              "areaId": {
                                "type": "string"
                              },
                              "tags": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "metadata": {
                                "type": "string"
                              },
                              "order": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "_id",
                              "title",
                              "createdAt",
                              "updatedAt",
                              "displayId"
                            ]
                          }
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "list",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "data": [
                    {
                      "_id": "USERSTORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                      "title": "User can log in",
                      "description": "As a user, I want to log in so that I can access my account",
                      "priority": "high",
                      "status": "todo",
                      "storyPoints": 5,
                      "displayId": "US-001",
                      "createdAt": "2024-01-01T00:00:00.000Z",
                      "updatedAt": "2024-01-01T00:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "listUserStories",
                    "description": "The RPC operation name. Must be exactly \"listUserStories\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "Product ID"
                      }
                    },
                    "required": [
                      "productId"
                    ],
                    "description": "Parameters for fetching user stories by product ID"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "listUserStories",
                "input": {
                  "productId": "PRODUCT-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/patchUserStory": {
      "post": {
        "operationId": "patchUserStory",
        "summary": "Patch User Story",
        "description": "Apply patch changes to a user story\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"patchUserStory\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SingleCaseResponse"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "userStoryId": {
                              "type": "string",
                              "description": "User story ID"
                            },
                            "patch": {
                              "type": "array",
                              "description": "JSON Patch operations",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "op": {
                                    "type": "string",
                                    "description": "The operation type"
                                  },
                                  "path": {
                                    "type": "string",
                                    "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Value for add/replace operations"
                                  },
                                  "from": {
                                    "type": "string",
                                    "description": "Source path for move/copy operations"
                                  }
                                },
                                "required": [
                                  "op",
                                  "path"
                                ],
                                "description": "A single JSON Patch operation (RFC 6902)"
                              }
                            },
                            "patchId": {
                              "type": "string",
                              "description": "Patch ID"
                            }
                          },
                          "required": [
                            "userStoryId",
                            "patch",
                            "patchId"
                          ],
                          "description": "Output for patching a user story"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "meta": {
                    "dataCategory": "single",
                    "status": 200,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "data": {
                    "userStoryId": "USER_STORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                    "patch": [
                      {
                        "op": "replace",
                        "path": "/name",
                        "value": "Updated Story Name"
                      }
                    ],
                    "patchId": "PATCH-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "patchUserStory",
                    "description": "The RPC operation name. Must be exactly \"patchUserStory\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "userStoryId": {
                        "type": "string",
                        "description": "User story ID"
                      },
                      "patch": {
                        "type": "array",
                        "description": "JSON Patch operations",
                        "items": {
                          "type": "object",
                          "properties": {
                            "op": {
                              "type": "string",
                              "description": "The operation type"
                            },
                            "path": {
                              "type": "string",
                              "description": "JSON pointer format path (e.g., \"/requirements/0/title\")"
                            },
                            "value": {
                              "type": "string",
                              "description": "Value for add/replace operations"
                            },
                            "from": {
                              "type": "string",
                              "description": "Source path for move/copy operations"
                            }
                          },
                          "required": [
                            "op",
                            "path"
                          ],
                          "description": "A single JSON Patch operation (RFC 6902)"
                        }
                      },
                      "comment": {
                        "type": "string",
                        "description": "Patch comment"
                      }
                    },
                    "required": [
                      "userStoryId",
                      "patch"
                    ],
                    "description": "Parameters for patching a user story"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "patchUserStory",
                "input": {
                  "userStoryId": "USER_STORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "patch": [
                    {
                      "op": "replace",
                      "path": "/name",
                      "value": "Updated Story Name"
                    }
                  ],
                  "comment": "Update story name"
                }
              }
            }
          }
        }
      }
    },
    "/rpc/reorderUserStories": {
      "post": {
        "operationId": "reorderUserStories",
        "summary": "Reorder User Stories",
        "description": "Atomically reorder user stories within an area using a database transaction\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"reorderUserStories\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "reorderUserStories",
                    "description": "The RPC operation name. Must be exactly \"reorderUserStories\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "productId": {
                        "type": "string",
                        "description": "ID of the product containing the user stories to reorder"
                      },
                      "areaId": {
                        "type": "string",
                        "description": "ID of the area containing the user stories to reorder"
                      },
                      "from": {
                        "type": "number",
                        "description": "The current position (0-based index) of the user story to move"
                      },
                      "to": {
                        "type": "number",
                        "description": "The target position (0-based index) where the user story should be moved to"
                      }
                    },
                    "required": [
                      "productId",
                      "areaId",
                      "from",
                      "to"
                    ],
                    "description": "Schema for reorderUserStoriesInput"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "reorderUserStories",
                "input": {
                  "productId": "PROD-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "areaId": "AREA-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "from": 0,
                  "to": 2
                }
              }
            }
          }
        }
      }
    },
    "/rpc/updateUserStory": {
      "post": {
        "operationId": "updateUserStory",
        "summary": "Update User Story",
        "description": "Update an existing user story\n\n**Note:** Call `POST /rpc` with the `name` field set to `\"updateUserStory\"`.",
        "tags": [
          "userStory"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoDataCaseResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 400,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "validationError",
                    "title": "Bad Request",
                    "detail": "The request was malformed or invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 401,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "unauthenticatedRequest",
                    "title": "Unauthorized",
                    "detail": "Invalid or missing API key"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 403,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "userNotAuthorized",
                    "title": "Forbidden",
                    "detail": "Not authorized for this operation"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 404,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "resourceNotFound",
                    "title": "Not Found",
                    "detail": "The requested resource was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                },
                "example": {
                  "meta": {
                    "error": true,
                    "status": 500,
                    "timestamp": "2025-12-12T11:45:23.365Z"
                  },
                  "error": {
                    "type": "internalServerError",
                    "title": "Internal Server Error",
                    "detail": "An unexpected error occurred on the server"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "const": "updateUserStory",
                    "description": "The RPC operation name. Must be exactly \"updateUserStory\"."
                  },
                  "input": {
                    "type": "object",
                    "properties": {
                      "userStoryId": {
                        "type": "string",
                        "description": "User story ID"
                      },
                      "displayId": {
                        "type": "string",
                        "description": "User story display ID"
                      },
                      "name": {
                        "type": "string",
                        "description": "User story name"
                      },
                      "description": {
                        "type": "string",
                        "description": "User story description"
                      },
                      "status": {
                        "type": "string",
                        "description": "User story status"
                      },
                      "priority": {
                        "type": "string",
                        "description": "User story priority"
                      },
                      "acceptanceCriteria": {
                        "type": "array",
                        "description": "User story acceptance criteria",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "userStoryId",
                      "displayId"
                    ],
                    "description": "Update user story request"
                  }
                },
                "required": [
                  "name",
                  "input"
                ]
              },
              "example": {
                "name": "updateUserStory",
                "input": {
                  "userStoryId": "USER_STORY-f97658ab-4af4-420a-a1a3-2f2b3ae70bdb",
                  "displayId": "US-001",
                  "name": "Updated Story Name",
                  "description": "Updated description"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key for authentication. Obtain API keys from the user profile section."
      }
    },
    "schemas": {
      "SingleCaseResponse": {
        "type": "object",
        "required": [
          "meta",
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/SingleDataMetadata"
          },
          "data": {
            "description": "The response data object"
          }
        }
      },
      "ListCaseResponse": {
        "type": "object",
        "required": [
          "meta",
          "data"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/ListCaseMetadata"
          },
          "data": {
            "type": "array",
            "description": "Array of response data objects",
            "items": {}
          }
        }
      },
      "NoDataCaseResponse": {
        "type": "object",
        "required": [
          "meta"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/NoDataMetadata"
          }
        }
      },
      "SingleDataMetadata": {
        "type": "object",
        "required": [
          "dataCategory",
          "status",
          "timestamp"
        ],
        "properties": {
          "dataCategory": {
            "type": "string",
            "enum": [
              "single"
            ],
            "example": "single"
          },
          "status": {
            "type": "number",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          }
        }
      },
      "ListCaseMetadata": {
        "type": "object",
        "required": [
          "dataCategory",
          "status",
          "timestamp"
        ],
        "properties": {
          "dataCategory": {
            "type": "string",
            "enum": [
              "list"
            ],
            "example": "list"
          },
          "status": {
            "type": "number",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          },
          "filter": {
            "type": "object",
            "description": "Applied filter criteria"
          },
          "sort": {
            "type": "object",
            "description": "Applied sort criteria"
          },
          "page": {
            "type": "object",
            "properties": {
              "number": {
                "type": "number",
                "example": 1
              },
              "size": {
                "type": "number",
                "example": 10
              }
            }
          }
        }
      },
      "NoDataMetadata": {
        "type": "object",
        "required": [
          "dataCategory",
          "status",
          "timestamp"
        ],
        "properties": {
          "dataCategory": {
            "type": "string",
            "enum": [
              "none"
            ],
            "example": "none"
          },
          "status": {
            "type": "number",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-01T00:00:00.000Z"
          }
        }
      },
      "ApiErrorResponse": {
        "type": "object",
        "required": [
          "meta",
          "error"
        ],
        "properties": {
          "meta": {
            "type": "object",
            "required": [
              "error",
              "status",
              "timestamp"
            ],
            "properties": {
              "error": {
                "type": "boolean",
                "enum": [
                  true
                ],
                "description": "Indicates this is an error response",
                "example": true
              },
              "status": {
                "type": "number",
                "description": "HTTP status code",
                "example": 400
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "Timestamp when the error occurred",
                "example": "2024-01-01T00:00:00.000Z"
              }
            }
          },
          "error": {
            "type": "object",
            "required": [
              "type",
              "title",
              "detail"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "Error type identifier (AppErrorType)",
                "example": "validationError"
              },
              "title": {
                "type": "string",
                "description": "Human-readable error title",
                "example": "Validation Error"
              },
              "detail": {
                "type": "string",
                "description": "Detailed error message explaining what went wrong",
                "example": "The request data failed validation"
              }
            }
          }
        }
      }
    }
  }
}