openapi: 3.0.0
servers:
  - url: 'http://petstore.swagger.io/v2'
info:
  description: Used for verification of AuthorizationScope resolution issue
  version: 1.0.0
  title: OpenAPI Petstore
  license:
    name: Apache-2.0
    url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
paths:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: ''
      operationId: addPet
      responses:
        '405':
          description: Invalid input
      security:
        - petstore_auth:
            - 'write:pets'
            - 'read:pets'
        - petstore_beta_auth:
            - 'write:pets'
            - 'read:pets'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Pet'
  '/pet/{petId}':
    get:
      tags:
        - pet
      summary: Find pet by ID
      description: Returns a single pet
      operationId: getPetById
      parameters:
        - name: petId
          in: path
          description: ID of pet to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
        '400':
          description: Invalid ID supplied
        '404':
          description: Pet not found
      security:
        - petstore_auth:
            - 'read:pets'
        - petstore_beta_auth:
            - 'read:pets'
components:
  securitySchemes:
    petstore_auth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://petstore.swagger.io/oauth2/auth
          scopes:
            'write:pets': modify pets in your account
            'read:pets': read your pets
          tokenUrl: https://petstore.swagger.io/oauth2/token
    petstore_beta_auth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://petstore.beta.swagger.io/oauth2/auth
          scopes:
            'write:pets': modify pets in your account
            'read:pets': read your pets
          tokenUrl: https://petstore.beta.swagger.io/oauth2/token
  schemas:
    Pet:
      title: a Pet
      description: A pet for sale in the pet store
      type: object
      required:
        - name
        - photoUrls
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
          example: doggie
        photoUrls:
          type: array
          items:
            type: string
        status:
          type: string
          description: pet status in the store
          enum:
            - available
            - pending
            - sold
