openapi: 3.0.3
info:
  title: Pet Store
  version: 1.0.0
servers:
  - url: https://api.pets.example.com/v1
  - url: https://staging.pets.example.com/v1
components:
  securitySchemes:
    petstore_auth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.pets.example.com/oauth/token
          scopes:
            read:pets: Read pets
            write:pets: Modify pets
  schemas:
    Pet:
      type: object
      required: [name]
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string
          default: friendly
  parameters:
    PetId:
      name: petId
      in: path
      required: true
      example: 123
      schema:
        type: integer
        format: int64
paths:
  /pets:
    get:
      operationId: listPets
      tags: [pets]
      description: Lists pets, newest first.
      parameters:
        - name: limit
          in: query
          required: false
          description: How many pets to return.
          schema:
            type: integer
            default: 20
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum: [available, pending, sold]
            default: available
        - name: filter
          in: query
          required: false
          schema:
            type: string
        - name: X-Tenant-Id
          in: header
          required: true
          schema:
            type: string
            example: acme
      responses:
        '200':
          description: ok
    post:
      operationId: createPet
      tags: [pets]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Pet'
            example:
              id: 1
              name: Fido
      responses:
        '201':
          description: created
  /pets/{petId}:
    get:
      operationId: getPet
      tags: [pets]
      parameters:
        - $ref: '#/components/parameters/PetId'
      responses:
        '200':
          description: ok
  /store/orders:
    post:
      summary: Place order
      tags: [store]
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                petId:
                  type: integer
                requestId:
                  type: string
                  format: uuid
      responses:
        '200':
          description: ok
