Skip to content

Commit 42fcb6c

Browse files
41044 - add schema discriminator
1 parent 5a8269f commit 42fcb6c

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

detect.yml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ components:
103103

104104
DetectAttributesDetails:
105105
title: "DetectAttributesDetails"
106+
allOf:
107+
- $ref: "#/components/schemas/DetailItem"
108+
- $ref: "#/components/schemas/AttributesData"
109+
110+
AttributesData:
111+
title: "AttributesData"
106112
type: object
107113
properties:
108-
name:
109-
type: string
110-
description: "The name of the attribute."
111114
value:
112115
type: array
113116
description: "The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/)."
@@ -116,6 +119,13 @@ components:
116119

117120
DetectDetailsMeta:
118121
title: "DetectDetailsMeta"
122+
allOf:
123+
- $ref: "#/components/schemas/DetailItem"
124+
- $ref: "#/components/schemas/DetectMetaData"
125+
126+
127+
DetectMetaData:
128+
title: "DetectMetaData"
119129
type: object
120130
properties:
121131
confidence:
@@ -125,9 +135,6 @@ components:
125135
value:
126136
type: string
127137
description: "The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/)."
128-
name:
129-
type: string
130-
description: "The name of the attribute."
131138

132139
Detection:
133140
title: "Detection"
@@ -172,6 +179,30 @@ components:
172179
type: number
173180
description: "Server processing time for attribute detection, ms."
174181

182+
DetailItem:
183+
title: "DetailItem"
184+
type: object
185+
properties:
186+
name:
187+
description: "The name of the attribute."
188+
type: string
189+
discriminator:
190+
propertyName: name
191+
mapping:
192+
Age: "DetectAttributesDetails"
193+
EyeRight: "DetectDetailsMeta"
194+
EyeLeft: "DetectDetailsMeta"
195+
Emotion: "DetectDetailsMeta"
196+
Smile: "DetectDetailsMeta"
197+
Glasses: "DetectDetailsMeta"
198+
HeadCovering: "DetectDetailsMeta"
199+
ForeheadCovering: "DetectDetailsMeta"
200+
Mouth: "DetectDetailsMeta"
201+
MedicalMask: "DetectDetailsMeta"
202+
Occlusion: "DetectDetailsMeta"
203+
StrongMakeup: "DetectDetailsMeta"
204+
Headphones: "DetectDetailsMeta"
205+
175206
DetectionQuality:
176207
title: "DetectionQuality"
177208
type: object

0 commit comments

Comments
 (0)