-
Notifications
You must be signed in to change notification settings - Fork 5
/
server.yaml
335 lines (335 loc) · 8.24 KB
/
server.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
openapi: 3.0.2
info:
contact:
email: [email protected]
description: 'This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You
can find out more about
Swagger at [http://swagger.io](http://swagger.io). In the third iteration of the
pet store, we''ve switched to the design first approach!
You can now help us improve the API whether it''s by making changes to the definition
itself or to the code.
That way, with time, we can improve the API in general, and expose some of the
new features in OAS3.
Some useful links:
- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)'
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
termsOfService: http://swagger.io/terms/
title: Swagger Petstore - OpenAPI 3.0
version: 1.0.5
servers:
- url: /api/v3
externalDocs:
description: Find out more about Swagger
url: http://swagger.io
paths:
/store/inventory:
get:
description: Returns a map of status codes to quantities
operationId: getInventory
responses:
'200':
content:
application/json:
schema:
additionalProperties:
format: int32
type: integer
type: object
description: successful operation
500:
description: 'Plain error message'
content:
text/plain:
schema:
type: string
security:
- api_key: []
summary: Returns pet inventories by status
tags:
- store
/store/order:
post:
description: Place a new order in the store
operationId: placeOrder
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Order'
application/xml:
schema:
$ref: '#/components/schemas/Order'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
description: successful operation
'405':
description: Invalid input
summary: Place an order for a pet
tags:
- store
/store/order/{orderId}:
delete:
description: For valid response try integer IDs with value < 1000. Anything
above 1000 or nonintegers will generate API errors
operationId: deleteOrder
parameters:
- description: ID of the order that needs to be deleted
in: path
name: orderId
required: true
schema:
format: int64
type: integer
responses:
'202':
description: Successfully deleted
'400':
description: Invalid ID supplied
'404':
description: Order not found
summary: Delete purchase order by ID
tags:
- store
get:
description: For valid response try integer IDs with value <= 5 or > 10. Other
values will generated exceptions
operationId: getOrderById
parameters:
- description: ID of order that needs to be fetched
in: path
name: orderId
required: true
schema:
format: int64
type: integer
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
application/xml:
schema:
$ref: '#/components/schemas/Order'
description: successful operation
'400':
description: Invalid ID supplied
'404':
description: Order not found
summary: Find purchase order by ID
tags:
- store
components:
requestBodies:
Pet:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
$ref: '#/components/schemas/Pet'
description: Pet object that needs to be added to the store
UserArray:
content:
application/json:
schema:
items:
$ref: '#/components/schemas/User'
type: array
description: List of user object
schemas:
Address:
properties:
city:
example: Palo Alto
type: string
state:
example: CA
type: string
street:
example: 437 Lytton
type: string
zip:
example: '94301'
type: string
type: object
xml:
name: address
ApiResponse:
properties:
code:
format: int32
type: integer
message:
type: string
type:
type: string
type: object
xml:
name: '##default'
Category:
properties:
id:
example: 1
format: int64
type: integer
name:
example: Dogs
type: string
type: object
xml:
name: category
Customer:
properties:
address:
items:
$ref: '#/components/schemas/Address'
type: array
xml:
name: addresses
wrapped: true
id:
example: 100000
format: int64
type: integer
username:
example: fehguy
type: string
type: object
xml:
name: customer
Order:
properties:
complete:
type: boolean
id:
example: 10
format: int64
type: integer
petId:
example: 198772
format: int64
type: integer
quantity:
example: 7
format: int32
type: integer
shipDate:
format: date-time
type: string
status:
description: Order Status
enum:
- placed
- approved
- delivered
example: approved
type: string
type: object
xml:
name: order
Pet:
properties:
category:
$ref: '#/components/schemas/Category'
id:
example: 10
format: int64
type: integer
name:
example: doggie
type: string
photoUrls:
items:
type: string
xml:
name: photoUrl
type: array
xml:
wrapped: true
status:
description: pet status in the store
enum:
- available
- pending
- sold
type: string
tags:
items:
$ref: '#/components/schemas/Tag'
type: array
xml:
wrapped: true
required:
- name
- photoUrls
type: object
xml:
name: pet
Tag:
properties:
id:
format: int64
type: integer
name:
type: string
type: object
xml:
name: tag
User:
properties:
email:
example: [email protected]
type: string
firstName:
example: John
type: string
id:
example: 10
format: int64
type: integer
lastName:
example: James
type: string
password:
example: '12345'
type: string
phone:
example: '12345'
type: string
userStatus:
description: User Status
example: 1
format: int32
type: integer
username:
example: theUser
type: string
type: object
xml:
name: user
securitySchemes:
api_key:
in: header
name: api_key
type: apiKey
petstore_auth:
flows:
implicit:
authorizationUrl: https://petstore3.swagger.io/oauth/authorize
scopes:
read:pets: read your pets
write:pets: modify pets in your account
type: oauth2