Skip to content

Commit a040a3d

Browse files
andrewhallacyAndrew
andauthored
adding tags info to annotations dogs (#2121)
Co-authored-by: Andrew <[email protected]>
1 parent f88f76c commit a040a3d

File tree

1 file changed

+91
-1
lines changed

1 file changed

+91
-1
lines changed

openapi/src/annotations.openapi.yaml

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ paths:
6363
$ref: '#/components/schemas/InputDate'
6464
description:
6565
$ref: '#/components/schemas/InputDescription'
66+
tags:
67+
$ref: '#/components/schemas/TagIds'
6668
tags:
6769
- Create Annotations
6870
summary: Create Annotations
@@ -119,6 +121,8 @@ paths:
119121
properties:
120122
description:
121123
$ref: '#/components/schemas/InputDescription'
124+
tags:
125+
$ref: '#/components/schemas/TagIds'
122126
responses:
123127
'200':
124128
description: Success
@@ -147,6 +151,51 @@ paths:
147151
$ref: ./common/responses.yaml#/401Unauthorized
148152
'403':
149153
$ref: ./common/responses.yaml#/403Forbidden
154+
/projects/{projectId}/annotations/tags:
155+
parameters:
156+
- $ref: ./common/parameters.yaml#/path/projectId
157+
get:
158+
operationId: get-annotation-tags
159+
tags:
160+
- Get Annotation tags
161+
description: Get all tags that have been added to at least one annotation. Requires a role of at least Analyst
162+
summary: Get Annotation Tags
163+
responses:
164+
'200':
165+
description: Success
166+
content:
167+
application/json:
168+
schema:
169+
$ref: '#/components/schemas/GetAnnotationTagsResponse'
170+
'401':
171+
$ref: ./common/responses.yaml#/401Unauthorized
172+
'403':
173+
$ref: ./common/responses.yaml#/403Forbidden
174+
post:
175+
operationId: create-annotation-tag
176+
tags:
177+
- Create Annotation tag
178+
description: Creates a new tag using the provided name. Requires a role of at least Analyst
179+
summary: Create Annotation Tag
180+
requestBody:
181+
required: true
182+
content:
183+
application/json:
184+
schema:
185+
properties:
186+
name:
187+
$ref: '#/components/schemas/TagName'
188+
responses:
189+
'200':
190+
description: Success
191+
content:
192+
application/json:
193+
schema:
194+
$ref: '#/components/schemas/AnnotationTag'
195+
'401':
196+
$ref: ./common/responses.yaml#/401Unauthorized
197+
'403':
198+
$ref: ./common/responses.yaml#/403Forbidden
150199
components:
151200
securitySchemes:
152201
$ref: ./common/securitySchemes.yaml
@@ -181,7 +230,6 @@ components:
181230
id:
182231
type: number
183232
description: 'The id of the deleted annotation'
184-
185233
ListAnnotationsResponse:
186234
title: ListAnnotationsResponse
187235
description: "A JSON response object containing all annotations in the project'"
@@ -211,6 +259,25 @@ components:
211259
type: number
212260
user:
213261
$ref: '#/components/schemas/UserInfo'
262+
tags:
263+
type: array
264+
items:
265+
$ref: '#/components/schemas/SimpleTag'
266+
SimpleTag:
267+
title: SimpleTag
268+
description: Basic info about an Annotation Tag
269+
type: object
270+
properties:
271+
id:
272+
type: number
273+
name:
274+
type: string
275+
TagIds:
276+
title: TagIds
277+
description: The ids of the tags to be added to the annotation
278+
type: array
279+
items:
280+
type: number
214281
UserInfo:
215282
title: UserInfo
216283
description: Info about the creator of the annotation
@@ -224,6 +291,29 @@ components:
224291
last_name:
225292
example: Smith
226293
type: string
294+
GetAnnotationTagsResponse:
295+
title: GetAnnotationTagsResponse
296+
description: The list of annotation tags that have been created
297+
type: array
298+
items:
299+
$ref: '#/components/schemas/AnnotationTag'
300+
AnnotationTag:
301+
title: AnnotationTag
302+
description: An annotation tag
303+
type: object
304+
properties:
305+
id:
306+
type: number
307+
name:
308+
type: string
309+
project_id:
310+
type: number
311+
has_annotations:
312+
type: boolean
313+
description: whether the tag is currently attached to any annotations
314+
TagName:
315+
type: string
316+
description: 'The text that will be shown when the tag is added to an annotation'
227317
InputDate:
228318
type: string
229319
description: 'A string representation of a date in "YYYY-MM-DD HH:mm:ss" format'

0 commit comments

Comments
 (0)