-
Notifications
You must be signed in to change notification settings - Fork 0
/
persons.yml
229 lines (224 loc) · 6.67 KB
/
persons.yml
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
openapi: 3.0.3
paths:
/persons:
parameters:
- $ref: './common.yml#/components/parameters/x-request'
post:
tags:
- person
summary: Create person
operationId: create_person
requestBody:
required: true
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/PersonFields"
responses:
201:
$ref: "#/components/responses/SuccessPerson"
400:
$ref: "./common.yml#/components/responses/BadRequest"
/persons/{personId}:
parameters:
- $ref: '#/components/parameters/personId'
- $ref: './common.yml#/components/parameters/x-request'
get:
tags:
- person
summary: Get person
operationId: get_person
responses:
200:
$ref: "#/components/responses/SuccessPerson"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
$ref: '#/components/responses/PersonNotFound'
put:
tags:
- person
summary: Update person
operationId: update_person
requestBody:
description: "Request body for the Person to update."
required: true
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/PersonToUpdateFields"
responses:
204:
$ref: "#/components/responses/SuccessEmpty"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
$ref: '#/components/responses/PersonNotFound'
delete:
tags:
- person
summary: Delete person
operationId: delete_person
responses:
204:
$ref: "#/components/responses/SuccessEmpty"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
$ref: '#/components/responses/PersonNotFound'
/persons/{personId}/images:
parameters:
- $ref: '#/components/parameters/personId'
- $ref: './common.yml#/components/parameters/x-request'
get:
tags:
- person
summary: Get person images
operationId: get_all_images_by_person_id
parameters:
- $ref: './common.yml#/components/parameters/page'
- $ref: './common.yml#/components/parameters/size'
responses:
200:
description: "Successful operation; return all person images."
content:
application/json:
schema:
$ref: "#/definitions/ImagePage"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
$ref: '#/components/responses/PersonNotFound'
post:
tags:
- person
summary: Add person image
operationId: add_image_to_person
requestBody:
description: "Image to add."
required: true
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/AddImageToPersonRequest"
responses:
200:
description: "Successful operation; return image ID."
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/AddImageToPersonResponse"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
$ref: '#/components/responses/PersonNotFound'
/persons/{personId}/images/{imageId}:
parameters:
- $ref: '#/components/parameters/personId'
- $ref: './common.yml#/components/parameters/x-request'
get:
tags:
- person
summary: Get person image by id
operationId: get_image_of_person
parameters:
- $ref: '#/components/parameters/imageId'
responses:
404:
$ref: '#/components/responses/PersonNotFound'
description: "Such an image does not exists."
400:
$ref: "./common.yml#/components/responses/BadRequest"
description: "Person does not have such an image."
200:
description: "Successful operation, return image."
content:
image/*:
schema:
type: string
format: binary
delete:
tags:
- person
summary: Delete image of person
operationId: delete_image_of_person
parameters:
- $ref: '#/components/parameters/imageId'
responses:
204:
$ref: "#/components/responses/SuccessEmpty"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
description: "Person with the personId or image with the imageId is not found."
content:
application/json:
schema:
$ref: "./common.yml#/components/schemas/OperationLog"
/persons/{personId}/groups:
parameters:
- $ref: '#/components/parameters/personId'
- $ref: './common.yml#/components/parameters/x-request'
get:
tags:
- person
summary: Get person groups
operationId: get_all_groups_by_person_id
parameters:
- $ref: './common.yml#/components/parameters/page'
- $ref: './common.yml#/components/parameters/size'
responses:
200:
description: "Successful operation; return all groups."
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/GroupPage"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
$ref: '#/components/responses/PersonNotFound'
components:
parameters:
personId:
name: personId
in: path
description: "Person ID."
required: true
schema:
format: uuid
type: string
imageId:
name: imageId
in: path
description: "Image ID."
required: true
schema:
string: uuid
type: string
responses:
SuccessEmpty:
description: "Successful operation, return nothing."
SuccessPerson:
description: "Successful operation; return person."
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/Person"
PersonNotFound:
description: "Person with the personId is not found."
content:
application/json:
schema:
$ref: "./common.yml#/components/schemas/OperationLog"
definitions:
ImagePage:
allOf:
- $ref: './common.yml#/components/schemas/Page'
- type: object
description: "Image page."
properties:
items:
type: array
items:
$ref: "./identification.yml#/components/schemas/Image"