forked from theBoEffect/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
334 lines (330 loc) · 9.35 KB
/
swagger.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
openapi: 3.0.0
info:
version: 1.0.0
title: Boilerplate Service
description: A Boilerplate for services that run in docker or lambda
x-logo:
url: https://cdn-images-1.medium.com/max/280/1*vuHoiLlmWjuTJ9zK98jFtQ@2x.png
tags:
- name: System
description: Basic System Functionality
paths:
/logs:
post:
tags:
- System
summary: Write a new log to the console and the db
description: This is unlikely to be used with frequency.
operationId: writeLog
responses:
'201':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/oneLog'
'405':
description: Invalid input
'500':
description: Unknown error
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/writeLog'
description: Log data to be written
required: true
get:
tags:
- System
summary: Retrieve all logs in the system
description: 'Uses oData filtering to retrieve logs. You will need to use oData syntax.'
operationId: getLogs
parameters:
- name: $filter
in: query
description: oData filter Query
required: false
schema:
type: string
- name: $select
in: query
description: oData select Query
required: false
schema:
type: string
- name: $orderby
in: query
description: oData orderby Query
required: false
schema:
type: string
- name: $skip
in: query
description: oData skip Query
required: false
schema:
type: string
- name: $top
in: query
description: oData top Query
required: false
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Logs'
'/logs/{id}':
get:
tags:
- System
summary: Find a log with its ID
description: 'Codes should be "error", "notify", or "success".'
operationId: getLog
parameters:
- name: id
in: path
description: id of log type to return
required: true
schema:
type: string
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/oneLog'
'400':
description: Invalid code supplied
'404':
description: Log not found
patch:
tags:
- System
summary: Patch an existing Log
description: Patch an existing Log - This is not a normal action for logs, used here as an example of JSON Patch only.
operationId: patchLog
parameters:
- name: id
in: path
description: id of log type to update
required: true
schema:
type: string
responses:
'201':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/oneLog'
'405':
description: Invalid input
'500':
description: Unknown error
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/jsonPatch'
description: JSON Patch specific to your log object
required: true
/health:
get:
tags:
- System
summary: Health check
description: Health check
responses:
'200':
description: GET successful
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
#Global Security
security:
- bearer: []
servers:
- url: http://localhost:3000/api
components:
securitySchemes:
bearer:
type: http
scheme: bearer
description: 'Bearer based tokens, simply enter the token (prefixing with "bearer" is not required).'
basicAuth:
type: http
scheme: basic
openId:
type: openIdConnect
openIdConnectUrl: https://example.com/.well-known/openid-configuration
OAuth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://example.com/oauth/authorize
tokenUrl: https://example.com/oauth/token
scopes:
read: Grants read access
write: Grants write access
admin: Grants access to admin operations
schemas:
error:
required:
- id
- error
- message
properties:
id:
type: string
format: uuid
description: unique ID for the error
error:
type: string
description: type of error
message:
type: string
description: additional information about the error
Log:
type: object
properties:
id:
type: string
description: guid for this log
logTimestamp:
type: string
format: date-time
description: This is your rangeKey. This is a timestamp.
allOf:
- $ref: '#/components/schemas/writeLog'
writeLog:
type: object
required:
- message
properties:
code:
type: string
enum: ["ERROR", "SUCCESS", "NOTIFY", "LOG"]
message:
type: string
description: This should be any brief summary data in string format.
details:
type: object
description: You can directly pipe any error message objects to here.
oneLog:
properties:
type:
type: string
default: Log
data:
$ref: '#/components/schemas/Log'
Logs:
properties:
type:
type: string
default: Log
data:
type: array
items:
$ref: '#/components/schemas/Log'
jsonPatch:
additionalProperties: false
description: Details for JSONPatch can be found at http://jsonpatch.com/
type: array
items:
type: object
description: Reference the update model for the full paths to update
oneOf:
- required:
- op
- path
- value
properties:
op:
type: string
enum: ['replace', 'add', 'remove', 'test']
path:
type: string
description: 'A path to the property in the data model. For example /name/firstName or /emails/-'
value:
type: object
description: 'The object, array or object to set the property at the above path to'
- required:
- op
- path
- value
properties:
op:
type: string
enum: ['replace', 'add', 'remove', 'test']
path:
type: string
description: 'A path to the property in the data model. For example /name/firstName or /emails/-'
value:
type: string
description: 'The string, array or object to set the property at the above path to'
- required:
- op
- path
- value
properties:
op:
type: string
enum: ['replace', 'add', 'remove', 'test']
path:
type: string
description: 'A path to the property in the data model. For example /name/firstName or /emails/-'
value:
type: boolean
- required:
- op
- path
- value
properties:
op:
type: string
enum: ['replace', 'add', 'remove', 'test']
path:
type: string
description: 'A path to the property in the data model. For example /name/firstName or /emails/-'
value:
type: integer
description: 'The integer, array or object to set the property at the above path to'
- required:
- op
- path
properties:
op:
type: string
enum: ['remove']
path:
type: string
description: 'A path to the property in the data model. For example /name/firstName or /emails/-'
- required:
- op
- from
- path
properties:
op:
type: string
enum: ['copy', 'move']
from:
type: string
description: 'Path to copy or move from'
path:
type: string
description: 'Path to copy or move to'