| 1 | openapi: 3.0.3 |
| 2 | info: |
| 3 | title: Pet Store |
| 4 | version: 1.0.0 |
| 5 | servers: |
| 6 | - url: https://api.pets.example.com/v1 |
| 7 | - url: https://staging.pets.example.com/v1 |
| 8 | components: |
| 9 | securitySchemes: |
| 10 | petstore_auth: |
| 11 | type: oauth2 |
| 12 | flows: |
| 13 | clientCredentials: |
| 14 | tokenUrl: https://auth.pets.example.com/oauth/token |
| 15 | scopes: |
| 16 | read:pets: Read pets |
| 17 | write:pets: Modify pets |
| 18 | schemas: |
| 19 | Pet: |
| 20 | type: object |
| 21 | required: [name] |
| 22 | properties: |
| 23 | id: |
| 24 | type: integer |
| 25 | format: int64 |
| 26 | name: |
| 27 | type: string |
| 28 | tag: |
| 29 | type: string |
| 30 | default: friendly |
| 31 | parameters: |
| 32 | PetId: |
| 33 | name: petId |
| 34 | in: path |
| 35 | required: true |
| 36 | example: 123 |
| 37 | schema: |
| 38 | type: integer |
| 39 | format: int64 |
| 40 | paths: |
| 41 | /pets: |
| 42 | get: |
| 43 | operationId: listPets |
| 44 | tags: [pets] |
| 45 | description: Lists pets, newest first. |
| 46 | parameters: |
| 47 | - name: limit |
| 48 | in: query |
| 49 | required: false |
| 50 | description: How many pets to return. |
| 51 | schema: |
| 52 | type: integer |
| 53 | default: 20 |
| 54 | - name: status |
| 55 | in: query |
| 56 | required: false |
| 57 | schema: |
| 58 | type: string |
| 59 | enum: [available, pending, sold] |
| 60 | default: available |
| 61 | - name: filter |
| 62 | in: query |
| 63 | required: false |
| 64 | schema: |
| 65 | type: string |
| 66 | - name: X-Tenant-Id |
| 67 | in: header |
| 68 | required: true |
| 69 | schema: |
| 70 | type: string |
| 71 | example: acme |
| 72 | responses: |
| 73 | '200': |
| 74 | description: ok |
| 75 | post: |
| 76 | operationId: createPet |
| 77 | tags: [pets] |
| 78 | requestBody: |
| 79 | content: |
| 80 | application/json: |
| 81 | schema: |
| 82 | $ref: '#/components/schemas/Pet' |
| 83 | example: |
| 84 | id: 1 |
| 85 | name: Fido |
| 86 | responses: |
| 87 | '201': |
| 88 | description: created |
| 89 | /pets/{petId}: |
| 90 | get: |
| 91 | operationId: getPet |
| 92 | tags: [pets] |
| 93 | parameters: |
| 94 | - $ref: '#/components/parameters/PetId' |
| 95 | responses: |
| 96 | '200': |
| 97 | description: ok |
| 98 | /store/orders: |
| 99 | post: |
| 100 | summary: Place order |
| 101 | tags: [store] |
| 102 | requestBody: |
| 103 | content: |
| 104 | application/json: |
| 105 | schema: |
| 106 | type: object |
| 107 | properties: |
| 108 | petId: |
| 109 | type: integer |
| 110 | requestId: |
| 111 | type: string |
| 112 | format: uuid |
| 113 | responses: |
| 114 | '200': |
| 115 | description: ok |