openapi: 3.1.0
info:
  title: Supplier Cases
  version: 2.0.0
servers:
  - url: https://supplier.example.test
paths:
  /v2/cases:
    post:
      operationId: createCase
      requestBody:
        required: true
        content:
          application/vnd.supplier.case+json:
            schema:
              $ref: "#/components/schemas/CaseCreate"
      responses:
        "201":
          description: Case created
          headers:
            Location:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Case"
        "400":
          description: Invalid representation
        "415":
          description: Unsupported media type
components:
  schemas:
    CaseCreate:
      type: object
      required: [external_id, title]
      properties:
        external_id:
          type: string
        title:
          type: string
        priority:
          type: string
          enum: [low, normal, high]
    Case:
      allOf:
        - $ref: "#/components/schemas/CaseCreate"
        - type: object
          required: [id]
          properties:
            id:
              type: string
