Skip to content

Commit b825f3a

Browse files
SP-13696: Openapi corrections
1 parent fe9cd04 commit b825f3a

4 files changed

Lines changed: 107 additions & 6 deletions

File tree

common.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ components:
55
page:
66
name: page
77
in: query
8-
required: true
98
description: "The page number to get a list of persons or groups."
109
schema:
1110
type: integer
1211
default: 1
1312
size:
1413
name: size
1514
in: query
16-
required: true
1715
description: "The page size with a list of persons or groups, items."
1816
schema:
1917
type: integer
@@ -412,6 +410,10 @@ components:
412410
msg:
413411
type: string
414412
description: "Error message."
413+
metadata:
414+
type: object
415+
additionalProperties: true
416+
description: "A free-form object containing group's extended attributes."
415417
Page:
416418
type: object
417419
description: "Information about current page number and total pages count"

identification.yml

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ components:
5959
name:
6060
type: string
6161
description: "Person name."
62+
required: true
6263
metadata:
6364
type: object
6465
additionalProperties: true
@@ -69,6 +70,24 @@ components:
6970
items:
7071
type: string
7172
format: uuid
73+
PersonToUpdateFields:
74+
type: object
75+
description: "Person Request body: name and metadata."
76+
properties:
77+
name:
78+
type: string
79+
description: "Person name."
80+
metadata:
81+
type: object
82+
additionalProperties: true
83+
description: "A free-form object containing person's extended attributes."
84+
groups:
85+
type: array
86+
description: "Groups a person should be placed to. If no group is specified in request, a Default group is created and the person is placed to it."
87+
items:
88+
type: string
89+
format: uuid
90+
7291
ImageFields:
7392
type: object
7493
description: "Image in the request data, includes image and contentType."
@@ -101,6 +120,62 @@ components:
101120
limit:
102121
type: integer
103122
description: "The maximum number of results to be returned."
123+
124+
AddImageToPersonResponse:
125+
type: object
126+
description: "Image in the response."
127+
properties:
128+
id:
129+
type: string
130+
description: "Response image ID. The list is sorted by decreasing ID value."
131+
contentType:
132+
type: string
133+
description: "Original media type of the returned image."
134+
createdAt:
135+
type: string
136+
description: "Returned image creation date."
137+
path:
138+
type: string
139+
description: "Returned image path."
140+
url:
141+
type: string
142+
description: "Returned image URL."
143+
metadata:
144+
type: object
145+
additionalProperties: true
146+
description: "A free-form object containing person's extended attributes."
147+
148+
AddImageToPersonRequest:
149+
type: object
150+
description: "Image in the request data, includes image and contentType."
151+
required:
152+
- image
153+
properties:
154+
tag:
155+
type: string
156+
description: "Session identificator."
157+
image:
158+
type: object
159+
description: "Uploaded image."
160+
properties:
161+
contentType:
162+
type: string
163+
description: "Original media type of the uploaded image."
164+
content:
165+
$ref: "./common.yml#/components/schemas/ImageData"
166+
imageUrl:
167+
type: string
168+
description: "Image URL."
169+
resizeOptions:
170+
$ref: "#/components/schemas/ResizeOptions"
171+
threshold:
172+
type: number
173+
format: float
174+
description: "The similarity threshold."
175+
limit:
176+
type: integer
177+
description: "The maximum number of results to be returned."
178+
104179
ResizeOptions:
105180
type: object
106181
description: "Set to resize the original image."
@@ -115,6 +190,7 @@ components:
115190
type: integer
116191
default: 100
117192
description: "Resized image quality, percent."
193+
118194
Image:
119195
type: object
120196
description: "Image in the response."
@@ -141,6 +217,7 @@ components:
141217
type: object
142218
additionalProperties: true
143219
description: "A free-form object containing person's extended attributes."
220+
144221
GroupPage:
145222
allOf:
146223
- type: object
@@ -153,7 +230,7 @@ components:
153230
- $ref: './common.yml#/components/schemas/Page'
154231
Group:
155232
allOf:
156-
- $ref: '#/components/schemas/GroupToCreate'
233+
- $ref: '#/components/schemas/GroupResponse'
157234
- type: object
158235
description: "Additional group data in the response, includes id and createdAt."
159236
properties:
@@ -164,6 +241,21 @@ components:
164241
createdAt:
165242
type: string
166243
description: "Group creation date."
244+
245+
GroupResponse:
246+
type: object
247+
description: "Response group create data, includes name and metadata."
248+
properties:
249+
name:
250+
type: string
251+
required: true
252+
description: "Group to create name."
253+
metadata:
254+
type: object
255+
required: true
256+
additionalProperties: true
257+
description: "A free-form object containing group's extended attributes."
258+
167259
GroupToCreate:
168260
type: object
169261
description: "Request body of the group to create data, includes name and metadata."
@@ -173,8 +265,10 @@ components:
173265
description: "Session identificator."
174266
name:
175267
type: string
268+
required: true
176269
description: "Group to create name."
177270
metadata:
178271
type: object
272+
required: true
179273
additionalProperties: true
180274
description: "A free-form object containing group's extended attributes."

matching.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ components:
128128
description: "The array of matching results."
129129
items:
130130
$ref: "#/components/schemas/MatchImageResult"
131+
metadata:
132+
type: object
133+
additionalProperties: true
134+
description: "A free-form object containing person's extended attributes."
131135

132136
MatchImageResult:
133137
type: object

persons.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ paths:
4848
content:
4949
application/json:
5050
schema:
51-
$ref: "./identification.yml#/components/schemas/PersonFields"
51+
$ref: "./identification.yml#/components/schemas/PersonToUpdateFields"
5252
responses:
5353
204:
5454
$ref: "#/components/responses/SuccessEmpty"
@@ -102,14 +102,15 @@ paths:
102102
content:
103103
application/json:
104104
schema:
105-
$ref: "./identification.yml#/components/schemas/ImageFields"
105+
$ref: "./identification.yml#/components/schemas/AddImageToPersonRequest"
106+
106107
responses:
107108
200:
108109
description: "Successful operation; return image ID."
109110
content:
110111
application/json:
111112
schema:
112-
$ref: "./identification.yml#/components/schemas/Image"
113+
$ref: "./identification.yml#/components/schemas/AddImageToPersonResponse"
113114
400:
114115
$ref: "./common.yml#/components/responses/BadRequest"
115116
404:

0 commit comments

Comments
 (0)