Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openapi: 3.0.0
- servers:
- - url: 'http://petstore.swagger.io/v2'
- info:
- description: >-
- This is a sample server Petstore server. For this sample, you can use the api key
- `special-key` to test the authorization filters.
- version: 1.0.0
- title: OpenAPI Petstore
- license:
- name: Apache-2.0
- url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
- tags:
- - name: pet
- description: Everything about your Pets
- paths:
- '/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:
- - api_key: []
- post:
- tags:
- - pet
- summary: Updates a pet in the store with form data
- description: ''
- operationId: updatePetWithForm
- parameters:
- - name: petId
- in: path
- description: ID of pet that needs to be updated
- required: true
- schema:
- type: integer
- format: int64
- responses:
- '405':
- description: Invalid input
- security:
- - petstore_auth:
- - 'write:pets'
- - 'read:pets'
- requestBody:
- content:
- application/x-www-form-urlencoded:
- schema:
- type: object
- properties:
- name:
- description: Updated name of the pet
- type: string
- status:
- description: Updated status of the pet
- type: string
- delete:
- tags:
- - pet
- summary: Deletes a pet
- description: ''
- operationId: deletePet
- parameters:
- - name: api_key
- in: header
- required: false
- schema:
- type: string
- - name: petId
- in: path
- description: Pet id to delete
- required: true
- schema:
- type: integer
- format: int64
- responses:
- '400':
- description: Invalid pet value
- security:
- - petstore_auth:
- - 'write:pets'
- - 'read:pets'
- externalDocs:
- description: Find out more about Swagger
- url: 'http://swagger.io'
- components:
- requestBodies:
- Pet:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Pet'
- description: Pet object that needs to be added to the store
- required: true
- securitySchemes:
- petstore_auth:
- type: oauth2
- flows:
- implicit:
- authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
- scopes:
- 'write:pets': modify pets in your account
- 'read:pets': read your pets
- api_key:
- type: apiKey
- name: api_key
- in: header
- schemas:
- Category:
- title: Category
- description: A category for a pet
- type: object
- properties:
- id:
- type: integer
- format: int64
- name:
- type: string
- Tag:
- title: Tag
- description: A tag for a pet
- type: object
- properties:
- id:
- type: integer
- format: int64
- name:
- type: string
- Pet:
- title: Pet
- description: A pet for sale in the pet store
- type: object
- required:
- - name
- - photoUrls
- properties:
- id:
- type: integer
- format: int64
- category:
- $ref: '#/components/schemas/Category'
- name:
- type: string
- example: doggie
- photoUrls:
- type: array
- items:
- type: string
- tags:
- type: array
- items:
- $ref: '#/components/schemas/Tag'
- status:
- $ref: '#/components/schemas/Status'
- Status:
- type: string
- enum:
- - available
- - pending
- - sold
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement