9
9
- url : ' http://localhost:8080'
10
10
tags :
11
11
- name : book
12
+ - name : log
12
13
13
14
paths :
14
15
/books :
@@ -136,6 +137,54 @@ paths:
136
137
responses :
137
138
' 204 ' :
138
139
description : successful operation
140
+ /logs :
141
+ get :
142
+ tags :
143
+ - log
144
+ summary : Render all logs
145
+ description : Show all logs from database
146
+ operationId : renderAllLogs
147
+ responses :
148
+ ' 200 ' :
149
+ description : Successful operation
150
+ content :
151
+ application/json :
152
+ schema :
153
+ type : array
154
+ items :
155
+ $ref : ' #/components/schemas/LogModel'
156
+ ' 400 ' :
157
+ description : Bad request
158
+ ' 401 ' :
159
+ description : Unauthorized
160
+ ' 403 ' :
161
+ description : Forbidden
162
+ ' 404 ' :
163
+ description : Book not found
164
+ ' 405 ' :
165
+ description : Validation exception
166
+ post :
167
+ tags :
168
+ - log
169
+ summary : Add a new log to the database
170
+ description : Add a new log to the database
171
+ operationId : addLog
172
+ requestBody :
173
+ description : Create a new log in the database
174
+ content :
175
+ application/json :
176
+ schema :
177
+ $ref : ' #/components/schemas/NewLogModel'
178
+ required : true
179
+ responses :
180
+ ' 201 ' :
181
+ description : Successful operation
182
+ content :
183
+ application/json :
184
+ schema :
185
+ $ref : ' #/components/schemas/LogModel'
186
+ ' 405 ' :
187
+ description : Invalid input
139
188
140
189
components :
141
190
schemas :
@@ -292,4 +341,30 @@ components:
292
341
enum :
293
342
- AVAILABLE
294
343
- ARCHIVE
295
- - DELETED
344
+ - DELETED
345
+ NewLogModel :
346
+ type : object
347
+ properties :
348
+ logMessage :
349
+ description : Log message
350
+ type : string
351
+ example : " {ERROR_CODE_001=Book with id: 4bc34bbf-6278-4586-9e62-429bc41edcf5 was not found}"
352
+ required :
353
+ - logMessage
354
+ LogModel :
355
+ type : object
356
+ properties :
357
+ id :
358
+ description : Id of log entity
359
+ type : string
360
+ format : uuid
361
+ example : ' 3a8ea9f1-1a95-4caf-932f-2f988052933b'
362
+ logMessage :
363
+ description : Log message
364
+ type : string
365
+ example : " {ERROR_CODE_001=Book with id: 4bc34bbf-6278-4586-9e62-429bc41edcf5 was not found}"
366
+ loggedAt :
367
+ description : Creation time of log
368
+ type : string
369
+ format : timestamp
370
+ example : ' 2019年01月21日T05:47:08.644'
0 commit comments