Skip to content

Commit 79d7e04

Browse files
Merge pull request #89 from regulaforensics/SP-13696/Openapi_corrections
SP-13696: Openapi corrections
2 parents 1d90cc9 + 3f194dc commit 79d7e04

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
@@ -55,6 +55,8 @@ components:
5555
PersonFields:
5656
type: object
5757
description: "Person Request body: name and metadata."
58+
required:
59+
- name
5860
properties:
5961
name:
6062
type: string
@@ -69,6 +71,24 @@ components:
6971
items:
7072
type: string
7173
format: uuid
74+
PersonToUpdateFields:
75+
type: object
76+
description: "Person Request body: name and metadata."
77+
properties:
78+
name:
79+
type: string
80+
description: "Person name."
81+
metadata:
82+
type: object
83+
additionalProperties: true
84+
description: "A free-form object containing person's extended attributes."
85+
groups:
86+
type: array
87+
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."
88+
items:
89+
type: string
90+
format: uuid
91+
7292
ImageFields:
7393
type: object
7494
description: "Image in the request data, includes image and contentType."
@@ -101,6 +121,62 @@ components:
101121
limit:
102122
type: integer
103123
description: "The maximum number of results to be returned."
124+
125+
AddImageToPersonResponse:
126+
type: object
127+
description: "Image in the response."
128+
properties:
129+
id:
130+
type: string
131+
description: "Response image ID. The list is sorted by decreasing ID value."
132+
contentType:
133+
type: string
134+
description: "Original media type of the returned image."
135+
createdAt:
136+
type: string
137+
description: "Returned image creation date."
138+
path:
139+
type: string
140+
description: "Returned image path."
141+
url:
142+
type: string
143+
description: "Returned image URL."
144+
metadata:
145+
type: object
146+
additionalProperties: true
147+
description: "A free-form object containing person's extended attributes."
148+
149+
AddImageToPersonRequest:
150+
type: object
151+
description: "Image in the request data, includes image and contentType."
152+
required:
153+
- image
154+
properties:
155+
tag:
156+
type: string
157+
description: "Session identificator."
158+
image:
159+
type: object
160+
description: "Uploaded image."
161+
properties:
162+
contentType:
163+
type: string
164+
description: "Original media type of the uploaded image."
165+
content:
166+
$ref: "./common.yml#/components/schemas/ImageData"
167+
imageUrl:
168+
type: string
169+
description: "Image URL."
170+
resizeOptions:
171+
$ref: "#/components/schemas/ResizeOptions"
172+
threshold:
173+
type: number
174+
format: float
175+
description: "The similarity threshold."
176+
limit:
177+
type: integer
178+
description: "The maximum number of results to be returned."
179+
104180
ResizeOptions:
105181
type: object
106182
description: "Set to resize the original image."
@@ -115,6 +191,7 @@ components:
115191
type: integer
116192
default: 100
117193
description: "Resized image quality, percent."
194+
118195
Image:
119196
type: object
120197
description: "Image in the response."
@@ -141,6 +218,7 @@ components:
141218
type: object
142219
additionalProperties: true
143220
description: "A free-form object containing person's extended attributes."
221+
144222
GroupPage:
145223
allOf:
146224
- type: object
@@ -153,7 +231,7 @@ components:
153231
- $ref: './common.yml#/components/schemas/Page'
154232
Group:
155233
allOf:
156-
- $ref: '#/components/schemas/GroupToCreate'
234+
- $ref: '#/components/schemas/GroupResponse'
157235
- type: object
158236
description: "Additional group data in the response, includes id and createdAt."
159237
properties:
@@ -164,9 +242,25 @@ components:
164242
createdAt:
165243
type: string
166244
description: "Group creation date."
245+
246+
GroupResponse:
247+
type: object
248+
description: "Response group create data, includes name and metadata."
249+
properties:
250+
name:
251+
type: string
252+
description: "Group to create name."
253+
metadata:
254+
type: object
255+
additionalProperties: true
256+
description: "A free-form object containing group's extended attributes."
257+
167258
GroupToCreate:
168259
type: object
169260
description: "Request body of the group to create data, includes name and metadata."
261+
required:
262+
- name
263+
- metadata
170264
properties:
171265
tag:
172266
type: string

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)