{
  "openapi": "3.0.3",
  "info": {
    "title": "Complex Endpoint Test API",
    "version": "1.0.0"
  },
  "paths": {
    "/api/v1/organizations/{orgId}/projects/{projectId}/tasks": {
      "get": {
        "operationId": "getProjectTasks",
        "summary": "Get Tasks",
        "description": "Retrieve a list of tasks for a specific project.",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["active", "completed"]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["created", "updated", "priority"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of tasks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskList"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createProjectTask",
        "summary": "Create Task",
        "description": "Create a new task within a project.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Task created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Task": {
        "type": "object",
        "required": ["id", "title", "status"],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["active", "completed"]
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          }
        }
      },
      "TaskList": {
        "type": "object",
        "required": ["items"],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          },
          "totalCount": {
            "type": "integer"
          }
        }
      },
      "CreateTaskRequest": {
        "type": "object",
        "required": ["title"],
        "properties": {
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["active", "completed"],
            "default": "active"
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5,
            "default": 3
          }
        }
      }
    }
  }
}
