openapi: "3.0.0"
info:
  version: 1.0.0
  title: Swagger Petstore
  license:
    name: MIT
  description: |
    This description is for testing
    multi-line
    description

servers:
  - url: http://petstore.swagger.io/v1
security:
  - BearerAuth: []
paths:
  /pets/{petId}:
    get:
      summary: Get a pet by ID
      operationId: getPet
      parameters:
        - name: petId
          in: path
          required: true
          description: The pet ID
          schema:
            type: string
        - name: include
          in: query
          required: false
          description: Include additional data
          schema:
            type: string
      responses:
        '200':
          description: A pet
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Pet"
  /pets:
    get:
      summary: List all pets
      operationId: listPets
      parameters:
        - name: limit
          in: query
          description: How many items to return at one time (max 100)
          required: false
          schema:
            default: 0
            type: integer
        - name: HomeAddress
          in: query
          required: false
          schema:
            default: 'Unknown'
            type: string
        - name: kind
          in: query
          required: false
          schema:
            default: dog
            type: string
        - in: query
          name: filter

          # Wrap 'schema' into 'content.<media-type>'
          content:
            application/json: # <---- media type indicates how to serialize / deserialize the parameter content
              schema:
                type: object
                properties:
                  type:
                    type: string
                  color:
                    type: string
        - in: query
          name: multipleMediaFilter

          # Wrap 'schema' into 'content.<media-type>'
          content:
            application/xml: # <---- media type indicates how to serialize / deserialize the parameter content
              schema:
                type: object
                properties:
                  type:
                    type: string
                  media_type:
                    type: string
                    enum:
                      - xml
                      - json
                    default: xml
            application/json: # <---- media type indicates how to serialize / deserialize the parameter content
              schema:
                type: object
                properties:
                  type:
                    type: string
                  media_type:
                    type: string
                    enum:
                      - xml
                      - json
                    default: json
        - in: query
          name: empty
          content:
            application/json:
              {}
      responses:
        '200':
          description: A paged array of pets
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Pet"
        '500':
          description: An internal error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
    post:
      summary: Create a pet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                age:
                  type: integer
      responses:
        '201':
          description: Null response
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  parameters:
    MyParam:
      name: foo
      in: query
      schema:
        type: string
  schemas:
    Pet:
      required:
        - id
        - name
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    PetForm:
      title: PetForm
      type: object
      properties:
        name:
          type: string
        age:
          type: integer