-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
299 lines (299 loc) · 10.4 KB
/
openapi.yaml
File metadata and controls
299 lines (299 loc) · 10.4 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
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
openapi: 3.0.2
info:
title: Todo
version: 1.0.0
servers:
-
url: '{protocol}://{fqdn}:{port}/api/v1'
description: ''
variables:
protocol:
enum:
- http
- https
default: http
fqdn:
enum:
- localhost
default: localhost
port:
enum:
- '80'
- '443'
- '8080'
- '9080'
default: '8080'
tags:
- name: todos
description: CRUD operations for Todo items
- name: users
description: User profile information
paths:
/todos:
summary: Path used to manage the list of todos.
description: >-
The REST endpoint/path used to list and create zero or more `Todo` entities. This path contains a
`GET` and `POST` operation to perform the list and create tasks, respectively.
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Todo'
description: Successful response - returns an array of `Todo` entities.
operationId: getTodos
summary: List All todos
tags:
- todos
description: Gets a list of all `Todo` entities.
post:
requestBody:
description: A new `Todo` to be created.
content:
application/json:
schema:
$ref: '#/components/schemas/NewTodo'
required: true
responses:
'201':
description: Successful response.
operationId: createTodo
summary: Create a Todo
tags:
- todos
description: Creates a new instance of a `Todo`.
'/todos/{todoId}':
summary: Path used to manage a single Todo.
description: >-
The REST endpoint/path used to get, update, and delete single instances of an `Todo`. This path
contains `GET`, `PUT`, and `DELETE` operations used to perform the get, update, and delete tasks,
respectively.
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
description: Successful response - returns a single `Todo`.
operationId: getTodo
summary: Get a Todo
tags:
- todos
description: Gets the details of a single instance of a `Todo`.
put:
requestBody:
description: Updated `Todo` information.
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
required: true
responses:
'202':
description: Successful response.
operationId: updateTodo
summary: Update a Todo
tags:
- todos
description: Updates an existing `Todo`.
delete:
responses:
'204':
description: Successful response.
operationId: deleteTodo
summary: Delete a Todo
tags:
- todos
description: Deletes an existing `Todo`.
parameters:
-
name: todoId
description: A unique identifier for a `Todo`.
schema:
type: string
in: path
required: true
/users:
summary: Path used to manage the list of users.
description: >-
The REST endpoint/path used to list and create zero or more `User` entities. This path contains a
`GET` and `POST` operation to perform the list and create tasks, respectively.
get:
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
description: Successful response - returns an array of `User` entities.
operationId: getUsers
summary: List All users
tags:
- users
description: Gets a list of all `User` entities.
post:
requestBody:
description: A new `User` to be created.
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
'201':
description: Successful response.
operationId: createUser
summary: Create a User
tags:
- users
description: Creates a new instance of a `User`.
'/users/{userId}':
summary: Path used to manage a single User.
description: >-
The REST endpoint/path used to get, update, and delete single instances of an `User`. This path
contains `GET`, `PUT`, and `DELETE` operations used to perform the get, update, and delete tasks,
respectively.
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: Successful response - returns a single `User`.
operationId: getUser
summary: Get a User
tags:
- users
description: Gets the details of a single instance of a `User`.
put:
requestBody:
description: Updated `User` information.
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
'202':
description: Successful response.
operationId: updateUser
summary: Update a User
tags:
- users
description: Updates an existing `User`.
delete:
responses:
'204':
description: Successful response.
operationId: deleteUser
summary: Delete a User
tags:
- users
description: Deletes an existing `User`.
parameters:
-
name: userId
description: A unique identifier for a `User`.
schema:
type: string
in: path
required: true
components:
schemas:
Todo:
title: Todo
required:
- id
- title
- completed
type: object
allOf:
-
$ref: '#/components/schemas/NewTodo'
example:
id: 06dd1d3c-185e-11eb-aa91-2f2172d321e0
title: My Todo Task
description: More details here
completed: false
dueDate: '2020-10-29'
User:
title: User
description: ''
type: object
properties:
username:
type: string
x-java-field-annotations:
- '@javax.persistence.Id'
x-mysql-schema:
columnDefinition:
colName: username
colDataType: VARCHAR
colDataTypeArguments:
- argumentValue: 128
isString: false
hasMore: false
primaryKey: true
givenName:
type: string
familyName:
type: string
create:
format: date-time
type: string
example:
givenName: Deven
familyName: Phillips
create: '2020-11-13'
x-java-class-annotations:
- '@javax.persistence.Entity'
- '@javax.persistence.Table(name = "users")'
NewTodo:
title: NewTodo
description: ''
required:
- completed
- title
type: object
properties:
id:
format: uuid
type: string
x-java-field-annotations:
- '@javax.persistence.Id'
- '@javax.persistence.GeneratedValue(generator = "UUID")'
- '@javax.persistence.Column(name = "id", updatable = false, nullable = false)'
x-mysql-schema:
columnDefinition:
colName: id
colDataType: VARCHAR
colDataTypeArguments:
- argumentValue: 40
isString: false
hasMore: false
primaryKey: true
title:
type: string
description:
type: string
completed:
default: false
type: boolean
dueDate:
format: date-time
type: string
example:
title: My Todo Task
description: More details here
completed: false
dueDate: '2020-10-29'
x-java-class-annotations:
- '@javax.persistence.Entity'
- '@javax.persistence.Table(name = "todos")'