openapi: "3.0.0"
info:
  version: 1.0.0
  title: Elm generator test
  license:
    name: MIT
servers:
  - url: http://localhost:9000
paths:
  /data:
    post:
      tags:
        - primitive
      operationId: update
      requestBody:
        description: Request body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Primitive"
      responses:
        "200":
          description: Default response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Primitive"
  /header:
    post:
      parameters:
        - name: string
          in: header
          required: true
          schema:
            type: string
        - name: integer
          in: header
          schema:
            type: integer
        - name: headerType
          in: header
          schema:
            type: string
            enum: [left, right]
      responses:
        "200":
          description: Default response
          content:
            application/json:
              schema:
                type: string
  /maybe:
    get:
      responses:
        "200":
          description: Default response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Maybe"
  /path/{string}/{integer}/{enumeration}:
    get:
      parameters:
        - name: string
          in: path
          required: true
          schema:
            type: string
        - name: integer
          in: path
          required: true
          schema:
            type: integer
        - name: enumeration
          in: path
          required: true
          schema:
            type: string
            enum: [a, b, c]
      responses:
        "200":
          description: Default response
  /query:
    get:
      parameters:
        - name: string
          in: query
          schema:
            type: string
        - name: int
          in: query
          schema:
            type: integer
        - name: enum
          in: query
          schema:
            type: string
            enum: [a, b, c]
      responses:
        "200":
          description: Default response
  /secured:
    post:
      summary: Secured endpoint
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Authenticated
        "401":
          description: Unauthenticated
  /uuid:
    get:
      parameters:
        - name: value
          in: query
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: Default response
          content:
            application/json:
              schema:
                type: string
                format: uuid
components:
  schemas:
    Absent:
      description: Model having absent and null values
      required:
        - required
        - requiredNullable
      properties:
        default:
          type: string
        required:
          type: string
        nullable:
          type: string
          nullable: true
        requiredNullable:
          type: string
          nullable: true
    Array:
      description: Model with arrays
      required:
        - array
        - arrayOfArray
      properties:
        array:
          type: array
          items:
            type: string
        arrayOfArray:
          type: array
          items:
            type: array
            items:
              type: string
        arrayOfPrimitive:
          type: array
          items:
            $ref: "#/components/schemas/Primitive"
        arrayOfEnum:
          type: array
          items:
            $ref: "#/components/schemas/Enum"
    Composed:
      description: Composed model
      allOf:
        - $ref: "#/components/schemas/ComposedBase"
        - type: object
          properties:
            value:
              type: string
    ComposedBase:
      required:
        - base
      properties:
        base:
          type: number
    Discriminated:
      description: Discriminated model
      required:
        - kind
      properties:
        kind:
          type: string
      discriminator:
        propertyName: kind
    DiscriminatedA:
      allOf:
        - $ref: "#/components/schemas/Discriminated"
        - type: object
          properties:
            a:
              type: string
    DiscriminatedB:
      allOf:
        - $ref: "#/components/schemas/Discriminated"
        - type: object
          properties:
            b:
              type: string
    Enum:
      type: string
      enum:
        - foo
        - bar
        - baz
    Enumeric:
      type: number
      enum:
        - 1
        - 2
        - 3
    Maybe:
      description: Model using reserved words
      properties:
        type:
          type: string
        if:
          type: boolean
    OneOf:
      description: One of two models
      oneOf:
        - $ref: "#/components/schemas/OneOfA"
        - $ref: "#/components/schemas/OneOfB"
    OneOfA:
      properties:
        a:
          type: string
    OneOfB:
      properties:
        b:
          type: string
    Primitive:
      description: Model with primitive properties
      properties:
        string:
          type: string
        number:
          type: number
        float:
          type: number
          format: float
        double:
          type: number
          format: double
        integer:
          type: integer
        short:
          type: integer
          format: int32
        long:
          type: integer
          format: int64
        boolean:
          type: boolean
    Recursion:
      properties:
        maybe:
          $ref: "#/components/schemas/Recursion"
        list:
          type: array
          items:
            $ref: "#/components/schemas/Recursion"
        ref:
          $ref: "#/components/schemas/RecursionLoop"
    RecursionLoop:
      properties:
        ref:
          $ref: "#/components/schemas/Recursion"
    UnsafeCharacters:
      description: Model using unsafe characters
      properties:
        $prefix:
          type: string
        suffix$:
          type: string
        r@nd0m_$t#ff:
          type: string
        _before:
          type: string
        after_:
          type: string
        _both_:
          type: string
        in_the_middle:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
