Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 622efa2

Browse files
implementing first the log API and model in the contract
1 parent 2e4515d commit 622efa2

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

‎api-first-development-service-api-contract/src/main/resources/service-contract-api.yaml

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ servers:
99
- url: 'http://localhost:8080'
1010
tags:
1111
- name: book
12+
- name: log
1213

1314
paths:
1415
/books:
@@ -136,6 +137,54 @@ paths:
136137
responses:
137138
'204':
138139
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
139188

140189
components:
141190
schemas:
@@ -292,4 +341,30 @@ components:
292341
enum:
293342
- AVAILABLE
294343
- 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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /