forked from CiscoDevNet/OpenAPI_Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerated_openapi.yaml
More file actions
263 lines (253 loc) · 6.34 KB
/
Copy pathgenerated_openapi.yaml
File metadata and controls
263 lines (253 loc) · 6.34 KB
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
info:
contact:
name: API Support
url: https://developer.cisco.com
license:
name: MIT
url: https://opensource.org/licenses/MIT
termsOfService: http://example.com
description: '
The description for this API. It can be very long and **Markdown** is supported.
In this example, the tags is manually set. However, in a real world application,
it will be
enough to use the automatic tags feature based on blueprint, see the example for
blueprint
tags under the "examples/blueprint_tags" folder:
'
title: Pet API
version: 1.0.0
tags:
- name: Hello
description: The description of the **Hello** tag.
- name: Pet
description: The description of the **Pet** tag.
servers:
- description: Development Server
url: http://localhost:5000
externalDocs:
description: Find more info here
url: https://apiflask.com/docs
paths:
/:
get:
parameters: []
responses:
'200':
content:
application/json:
schema: {}
description: Successful response
tags:
- Hello
summary: Just Say Hello
description: 'It will always return a greeting like this:
```
{''message'': ''Hello!''}
```'
operationId: get_say_hello
/pets:
get:
parameters: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PetOut'
description: A list of pets
tags:
- Pet
summary: Get All Pet
description: Get all pets in the database.
operationId: get_get_pets
post:
parameters: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/PetOut'
description: The pet you just created
links:
getPetById:
operationId: getPet
parameters:
pet_id: $response.body#/id
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: Validation error
tags:
- Pet
summary: Create a Pet
description: Create a pet with given data. The created pet will be returned.
operationId: post_create_pet
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PetIn'
/pets/{pet_id}:
get:
parameters:
- in: path
name: pet_id
schema:
type: integer
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PetOut'
description: The pet with given ID
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
description: Not found
tags:
- Pet
summary: Get a Pet
description: Get details for the pet with `pet_id` identifier.
operationId: getPetDetails
patch:
parameters:
- in: path
name: pet_id
schema:
type: integer
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PetOut'
description: The updated pet
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
description: Validation error
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
description: Not found
tags:
- Pet
summary: Update a Pet
description: Update a pet with given data, the valid fields are `name` and `category`.
operationId: patch_update_pet
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PetInUpdate'
delete:
parameters:
- in: path
name: pet_id
schema:
type: integer
required: true
responses:
'204':
description: Empty
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPError'
description: Not found
tags:
- Pet
summary: Delete a Pet
description: Delete a pet with specific ID. The deleted pet will be renamed
to `"Ghost"`.
operationId: delete_delete_pet
openapi: 3.0.3
components:
schemas:
ValidationError:
properties:
detail:
type: object
properties:
<location>:
type: object
properties:
<field_name>:
type: array
items:
type: string
message:
type: string
type: object
HTTPError:
properties:
detail:
type: object
message:
type: string
type: object
PetOut:
type: object
properties:
id:
type: integer
title: Pet ID
description: The ID of the pet.
name:
type: string
title: Pet Name
description: The name of the pet.
category:
type: string
title: Pet Category
description: The category of the pet.
PetIn:
type: object
properties:
name:
type: string
minLength: 0
maxLength: 10
title: Pet Name
description: The name of the pet.
category:
type: string
enum:
- dog
- cat
title: Pet Category
description: The category of the pet.
required:
- category
- name
PetInUpdate:
type: object
properties:
name:
type: string
minLength: 0
maxLength: 10
title: Pet Name
description: The name of the pet.
category:
type: string
enum:
- dog
- cat
title: Pet Category
description: The category of the pet.