Skip to content

Commit

Permalink
Merge pull request #89 from regulaforensics/SP-13696/Openapi_corrections
Browse files Browse the repository at this point in the history
SP-13696: Openapi corrections
  • Loading branch information
KirylKovaliov committed Feb 19, 2024
2 parents 1d90cc9 + 3f194dc commit 79d7e04
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 6 deletions.
6 changes: 4 additions & 2 deletions common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ components:
page:
name: page
in: query
required: true
description: "The page number to get a list of persons or groups."
schema:
type: integer
default: 1
size:
name: size
in: query
required: true
description: "The page size with a list of persons or groups, items."
schema:
type: integer
Expand Down Expand Up @@ -412,6 +410,10 @@ components:
msg:
type: string
description: "Error message."
metadata:
type: object
additionalProperties: true
description: "A free-form object containing group's extended attributes."
Page:
type: object
description: "Information about current page number and total pages count"
Expand Down
96 changes: 95 additions & 1 deletion identification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ components:
PersonFields:
type: object
description: "Person Request body: name and metadata."
required:
- name
properties:
name:
type: string
Expand All @@ -69,6 +71,24 @@ components:
items:
type: string
format: uuid
PersonToUpdateFields:
type: object
description: "Person Request body: name and metadata."
properties:
name:
type: string
description: "Person name."
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."
groups:
type: array
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."
items:
type: string
format: uuid

ImageFields:
type: object
description: "Image in the request data, includes image and contentType."
Expand Down Expand Up @@ -101,6 +121,62 @@ components:
limit:
type: integer
description: "The maximum number of results to be returned."

AddImageToPersonResponse:
type: object
description: "Image in the response."
properties:
id:
type: string
description: "Response image ID. The list is sorted by decreasing ID value."
contentType:
type: string
description: "Original media type of the returned image."
createdAt:
type: string
description: "Returned image creation date."
path:
type: string
description: "Returned image path."
url:
type: string
description: "Returned image URL."
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."

AddImageToPersonRequest:
type: object
description: "Image in the request data, includes image and contentType."
required:
- image
properties:
tag:
type: string
description: "Session identificator."
image:
type: object
description: "Uploaded image."
properties:
contentType:
type: string
description: "Original media type of the uploaded image."
content:
$ref: "./common.yml#/components/schemas/ImageData"
imageUrl:
type: string
description: "Image URL."
resizeOptions:
$ref: "#/components/schemas/ResizeOptions"
threshold:
type: number
format: float
description: "The similarity threshold."
limit:
type: integer
description: "The maximum number of results to be returned."

ResizeOptions:
type: object
description: "Set to resize the original image."
Expand All @@ -115,6 +191,7 @@ components:
type: integer
default: 100
description: "Resized image quality, percent."

Image:
type: object
description: "Image in the response."
Expand All @@ -141,6 +218,7 @@ components:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."

GroupPage:
allOf:
- type: object
Expand All @@ -153,7 +231,7 @@ components:
- $ref: './common.yml#/components/schemas/Page'
Group:
allOf:
- $ref: '#/components/schemas/GroupToCreate'
- $ref: '#/components/schemas/GroupResponse'
- type: object
description: "Additional group data in the response, includes id and createdAt."
properties:
Expand All @@ -164,9 +242,25 @@ components:
createdAt:
type: string
description: "Group creation date."

GroupResponse:
type: object
description: "Response group create data, includes name and metadata."
properties:
name:
type: string
description: "Group to create name."
metadata:
type: object
additionalProperties: true
description: "A free-form object containing group's extended attributes."

GroupToCreate:
type: object
description: "Request body of the group to create data, includes name and metadata."
required:
- name
- metadata
properties:
tag:
type: string
Expand Down
4 changes: 4 additions & 0 deletions matching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ components:
description: "The array of matching results."
items:
$ref: "#/components/schemas/MatchImageResult"
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."

MatchImageResult:
type: object
Expand Down
7 changes: 4 additions & 3 deletions persons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ paths:
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/PersonFields"
$ref: "./identification.yml#/components/schemas/PersonToUpdateFields"
responses:
204:
$ref: "#/components/responses/SuccessEmpty"
Expand Down Expand Up @@ -102,14 +102,15 @@ paths:
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/ImageFields"
$ref: "./identification.yml#/components/schemas/AddImageToPersonRequest"

responses:
200:
description: "Successful operation; return image ID."
content:
application/json:
schema:
$ref: "./identification.yml#/components/schemas/Image"
$ref: "./identification.yml#/components/schemas/AddImageToPersonResponse"
400:
$ref: "./common.yml#/components/responses/BadRequest"
404:
Expand Down

0 comments on commit 79d7e04

Please sign in to comment.