swagger: "2.0"
info:
  description: "This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters."
  version: 1.0.0
  title: Swagger Petstore
  termsOfService: "http://swagger.io/terms/"
  contact:
    email: apiteam@swagger.io
  license:
    name: Apache 2.0
    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: petstore.swagger.io
basePath: /v2
tags:
- name: pet
  description: Everything about your Pets
  externalDocs:
    description: Find out more
    url: "http://swagger.io"
- name: store
  description: Access to Petstore orders
- name: user
  description: Operations about user
  externalDocs:
    description: Find out more about our store
    url: "http://swagger.io"
schemes:
- https
- http
paths:
  /pets:
    post:
      tags:
      - pet
      summary: Add a new pet to the store
      description: ""
      operationId: addPet
      consumes:
      - application/json
      - application/xml
      produces:
      - application/xml
      - application/json
      parameters:
      - in: body
        name: body
        description: Pet object that needs to be added to the store
        required: true
        schema:
          $ref: "#/definitions/Pet"
      responses:
        "405":
          description: Invalid input
      security:
      - petstore_auth:
        - "write:pets"
        - "read:pets"
    get:
      responses:
        "200":
          description: ""
          schema:
            type: object
            properties: {}
      summary: List pets
      parameters:
      - $ref: "#/parameters/skip"
      - $ref: "#/parameters/limit"
      - $ref: "#/parameters/rate-limit"
  "/pet/{petId}":
    parameters:
    - $ref: "#/parameters/pet-id"
    put:
      tags:
      - pet
      summary: Update an existing pet
      description: ""
      operationId: updatePet
      consumes:
      - application/json
      - application/xml
      produces:
      - application/xml
      - application/json
      parameters:
      - in: body
        name: body
        description: Pet object that needs to be added to the store
        required: true
        schema:
          $ref: "#/definitions/Pet"
      responses:
        "400":
          description: Invalid ID supplied
        "404":
          $ref: "#/responses/404"
        "405":
          description: Validation exception
      security:
      - petstore_auth:
        - "write:pets"
        - "read:pets"
securityDefinitions:
  petstore_auth:
    type: oauth2
    authorizationUrl: "https://petstore.swagger.io/oauth/dialog"
    flow: implicit
    scopes:
      "write:pets": modify pets in your account
      "read:pets": read your pets
  api_key:
    type: apiKey
    name: api_key
    in: header
definitions:
  Pet:
    type: object
    xml:
      name: Pet
    properties:
      id:
        type: integer
        format: int64
      category:
        $ref: "#/definitions/Category"
      name:
        type: string
        example: doggie
      photoUrls:
        type: array
        xml:
          name: photoUrl
          wrapped: true
        items:
          type: string
      status:
        type: string
        description: pet status in the store
        enum:
        - available
        - pending
        - sold
    required:
    - name
    - photoUrls
  Error:
    type: object
    properties:
      code:
        type: string
      message:
        type: string
    required:
    - code
  Category:
    type: object
    properties:
      name:
        type: string
    required:
    - name
    title: Category
externalDocs:
  description: Find out more about Swagger
  url: "http://swagger.io"
parameters:
  skip:
    in: query
    type: string
    name: skip
  rate-limit:
    name: Rate-Limit
    in: header
    type: string
  limit:
    name: limit
    in: query
    type: string
  pet-id:
    name: petId
    in: path
    type: string
    required: true
responses:
  "404":
    description: Our shared 404 response.
    schema:
      $ref: "#/definitions/Error"
