openapi: 3.0.3
info:
  title: Large Payload API
  version: 1.0.0
  description: API with complex nested payloads for memory testing

paths:
  /api/v1/organizations/{orgId}/projects:
    parameters:
      - name: orgId
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      summary: Create a new project with complex data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectCreationRequest'
      responses:
        '201':
          description: Project created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '400':
          description: Invalid request
        '422':
          description: Validation error

  /api/v1/organizations/{orgId}/projects/{projectId}:
    parameters:
      - name: orgId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
    put:
      summary: Update project with full data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectUpdateRequest'
      responses:
        '200':
          description: Project updated successfully

components:
  schemas:
    ProjectCreationRequest:
      type: object
      required:
        - name
        - description
        - projectType
        - startDate
        - endDate
        - teamMembers
        - tags
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 100
          pattern: '^[a-zA-Z0-9\s\-_]+$'
          description: Project name

        description:
          type: string
          minLength: 10
          maxLength: 5000
          description: Detailed project description

        projectType:
          type: string
          enum: ['research', 'development', 'infrastructure', 'marketing', 'operations']

        startDate:
          type: string
          format: date

        endDate:
          type: string
          format: date

        estimatedHours:
          type: integer
          minimum: 1
          maximum: 100000

        priority:
          type: integer
          minimum: 1
          maximum: 10
          default: 5

        isConfidential:
          type: boolean
          default: false

        teamMembers:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: object
            required:
              - userId
              - role
              - allocation
            properties:
              userId:
                type: string
                format: uuid
              role:
                type: string
                enum: ['lead', 'developer', 'designer', 'analyst', 'tester', 'manager', 'consultant']
              allocation:
                type: number
                minimum: 0
                maximum: 100
                description: Percentage allocation
              permissions:
                type: array
                items:
                  type: string
                  enum: ['read', 'write', 'delete', 'admin', 'approve', 'review']
              joinDate:
                type: string
                format: date
              skills:
                type: array
                maxItems: 30
                items:
                  type: string
                  maxLength: 50

        tags:
          type: array
          minItems: 1
          maxItems: 30
          items:
            type: string
            minLength: 2
            maxLength: 50
            pattern: '^[a-z0-9\-]+$'

        dependencies:
          type: array
          maxItems: 20
          items:
            type: object
            properties:
              projectId:
                type: string
                format: uuid
              dependencyType:
                type: string
                enum: ['blocks', 'requires', 'relates_to']
              description:
                type: string
                maxLength: 500

    ProjectUpdateRequest:
      allOf:
        - $ref: '#/components/schemas/ProjectCreationRequest'
        - type: object
          properties:
            status:
              type: string
              enum: ['draft', 'active', 'paused', 'completed', 'cancelled', 'archived']
            completionPercentage:
              type: number
              minimum: 0
              maximum: 100
            lastModifiedBy:
              type: string
              format: email
            lastModifiedAt:
              type: string
              format: date-time

    ProjectResponse:
      allOf:
        - $ref: '#/components/schemas/ProjectCreationRequest'
        - type: object
          required:
            - id
            - createdAt
            - updatedAt
          properties:
            id:
              type: string
              format: uuid
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            version:
              type: integer
              minimum: 1
