This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
/
PetStore.yaml
349 lines (329 loc) · 8.33 KB
/
PetStore.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
swagger: "2.0"
info:
version: 1.0.0
title: Swagger petstore
description: A sample API that demonstrates Swagger Express Middleware features
consumes:
- application/json
produces:
- application/json
definitions:
pet:
required:
- name
- type
properties:
name:
type: string
minLength: 4
pattern: "^[a-zA-Z0-9- ]+$"
age:
type: integer
dob:
type: string
format: 'date'
type:
type: string
enum: [cat, dog, bird]
address:
$ref: "#/definitions/address"
vet:
$ref: "#/definitions/veterinarian"
tags:
type: array
uniqueItems: true
items:
type: string
minLength: 1
veterinarian:
required:
- name
properties:
name:
type: string
minLength: 1
address:
$ref: "#/definitions/address"
address:
properties:
street:
type: string
minLength: 1
city:
type: string
minLength: 1
state:
type: string
minLength: 2
maxLength: 2
pattern: "^[A-Z]+$"
zipcode:
type: integer
minimum: 10000
maximum: 99999
pet-filters:
- name: tags
in: query
description: Filters pets by one or more tags
required: false
type: array
items:
type: string
uniqueItems: true
collectionFormat: csv
- name: type
in: query
description: Filters pets by type (dog, cat, or bird)
required: false
type: string
enum: [cat, dog, bird]
- name: age
in: query
description: Filters pets by age
required: false
type: integer
- name: dob
in: query
description: Filters pets by date of birth
required: false
type: string
format: date
- name: address.city
in: query
description: Filters pets by city
required: false
type: string
- name: address.state
in: query
description: Filters pets by state
required: false
type: string
- name: address.zipcode
in: query
description: Filters pets by zip code
required: false
type: integer
- name: vet.name
in: query
description: Filters pets by veterinarian name
required: false
type: string
- name: vet.address.city
in: query
description: Filters pets by veterinarian city
required: false
type: string
- name: vet.address.state
in: query
description: Filters pets by veterinarian state
required: false
type: string
- name: vet.address.zipcode
in: query
description: Filters pets by veterinarian zip code
required: false
type: integer
parameters:
petName:
name: petName
in: path
description: Name of the pet
required: true
type: string
paths:
/pets:
get:
description: Returns all pets, optionally filtered by one or more criteria
operationId: findPets
parameters:
$ref: '#/definitions/pet-filters'
responses:
default:
description: Returns the matching pets
schema:
type: array
items:
$ref: "#/definitions/pet"
headers:
last-modified:
type: string
description: The date/time that a pet was last modified
delete:
description: Deletes all pets, optionally filtered by one or more criteria
operationId: deletePets
parameters:
$ref: '#/definitions/pet-filters'
responses:
default:
description: Returns the pets that were deleted
schema:
type: array
items:
$ref: "#/definitions/pet"
post:
description: Creates a new pet in the store
operationId: addPet
parameters:
- name: pet
in: body
description: The pet to add to the store
required: true
schema:
$ref: "#/definitions/pet"
responses:
201:
description: Returns the newly-added pet
schema:
$ref: "#/definitions/pet"
headers:
Location:
type: string
description: The URL of the newly-added pet
/pets/{petName}:
parameters:
- $ref: "#/parameters/petName"
get:
description: Returns a pet by name
operationId: findPetByName
responses:
default:
description: Returns the pet data
schema:
$ref: "#/definitions/pet"
headers:
last-modified:
type: string
description: The date/time that the pet was last modified
delete:
description: Deletes a single pet based on the name supplied
operationId: deletePet
responses:
default:
description: Returns the pet that was deleted
schema:
$ref: "#/definitions/pet"
patch:
description: Updates a pet by name
parameters:
- name: pet
in: body
description: The updated pet info
required: true
schema:
$ref: "#/definitions/pet"
responses:
default:
description: Returns the updated pet data
schema:
$ref: "#/definitions/pet"
/pets/{petName}/photos:
parameters:
- $ref: "#/parameters/petName"
post:
description: Upload a new pet photo
operationId: addPetPhoto
consumes:
- multipart/form-data
parameters:
- name: id
in: formData
description: The photo ID (generated automatically)
type: integer
format: int32
minimum: 1
- name: label
in: formData
description: A label for the photo
required: true
type: string
minLength: 1
- name: description
in: formData
description: An optional description of the photo
type: string
- name: photo
in: formData
description: The pet photo
required: true
type: file
minLength: 1
maxLength: 5000000 # ~5MB
responses:
default:
description: Returns the photo information
schema:
properties:
id:
type: integer
format: int32
description: The auto-generated photo ID
label:
type: string
description:
type: string
photo:
type: object
description: Information about the photo (size, file name, etc.)
headers:
Location:
type: string
description: The URL of the newly-added photo
get:
description: Get a list of the photos for a pet
responses:
200:
description: Returns the list of photos
schema:
type: array
items:
properties:
id:
type: integer
format: int32
description: The auto-generated photo ID
label:
type: string
description:
type: string
photo:
type: object
description: Information about the photo (size, file name, etc.)
/pets/{petName}/photos/{id}:
parameters:
- $ref: "#/parameters/petName"
- name: id
in: path
description: The ID of the photo
required: true
type: integer
format: int32
get:
description: Gets a pet photo
operationId: getPetPhoto
produces:
- image/jpeg
- image/gif
- image/png
- image/bmp
responses:
default:
description: Returns the pet photo
schema:
type: file
delete:
description: Deletes a pet photo
operationId: deletePetPhoto
responses:
default:
description: The photo was deleted successfully
/:
get:
produces:
- text/html
responses:
default:
description: The Swagger Pet Store homepage :)
schema:
type: file
default:
$ref: "index.html"