Skip to content

Commit 4bd4122

Browse files
committed
DMP-5271 [API Validation] GET/transcriptions/{transcription_id}/documen — apply input validation (High)
Added input validation to get transcription document as well as ensuring response codes are single quoted
1 parent 47edfe0 commit 4bd4122

File tree

5 files changed

+45
-44
lines changed

5 files changed

+45
-44
lines changed

src/main/resources/openapi/annotations.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ paths:
3232
annotation:
3333
$ref: '#/components/schemas/annotation'
3434
responses:
35-
201:
35+
'201':
3636
description: CREATED
3737
content:
3838
application/json:
@@ -43,7 +43,7 @@ paths:
4343
content:
4444
application/json+problem:
4545
schema:
46-
$ref: './problem.yaml'
46+
$ref: './problem.yaml'
4747
'400':
4848
description: Bad Request Error
4949
content:
@@ -78,7 +78,7 @@ paths:
7878
content:
7979
application/json+problem:
8080
schema:
81-
$ref: './problem.yaml'
81+
$ref: './problem.yaml'
8282
'400':
8383
description: Bad Request Error
8484
content:
@@ -132,7 +132,7 @@ paths:
132132
content:
133133
application/json+problem:
134134
schema:
135-
$ref: './problem.yaml'
135+
$ref: './problem.yaml'
136136
'400':
137137
description: Bad Request Error
138138
content:

src/main/resources/openapi/audio.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ paths:
106106
type: string
107107
description: "Range header, required for streaming audio."
108108
responses:
109-
200:
109+
'200':
110110
description: OK
111111
content:
112112
audio/mpeg:
@@ -149,7 +149,7 @@ paths:
149149
type: "AUDIO_102"
150150
title: "The requested media cannot be found"
151151
status: 404
152-
500:
152+
'500':
153153
description: The requested data cannot be located
154154
content:
155155
application/json+problem:
@@ -172,15 +172,15 @@ paths:
172172
schema:
173173
$ref: '#/components/schemas/AddAudioMetadataRequestWithStorageGUID'
174174
responses:
175-
200:
175+
'200':
176176
description: Audio metadata accepted
177-
400:
177+
'400':
178178
description: Bad request
179179
content:
180180
application/json+problem:
181181
schema:
182182
$ref: './problem.yaml'
183-
500:
183+
'500':
184184
description: Internal server error
185185
content:
186186
application/json+problem:
@@ -201,7 +201,7 @@ paths:
201201
type: integer
202202
required: true
203203
responses:
204-
200:
204+
'200':
205205
description: OK
206206
content:
207207
application/json:

src/main/resources/openapi/audiorequests.yaml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ paths:
4040
content:
4141
application/json+problem:
4242
schema:
43-
$ref: './problem.yaml'
43+
$ref: './problem.yaml'
4444
'400':
4545
description: A required parameter is missing or an invalid.
4646
content:
@@ -81,7 +81,7 @@ paths:
8181
content:
8282
application/json+problem:
8383
schema:
84-
$ref: './problem.yaml'
84+
$ref: './problem.yaml'
8585
'400':
8686
description: A required parameter is missing or an invalid.
8787
content:
@@ -206,7 +206,7 @@ paths:
206206
content:
207207
application/json+problem:
208208
schema:
209-
$ref: './problem.yaml'
209+
$ref: './problem.yaml'
210210
'400':
211211
description: Bad Request Error
212212
content:
@@ -327,7 +327,7 @@ paths:
327327
content:
328328
application/json+problem:
329329
schema:
330-
$ref: './problem.yaml'
330+
$ref: './problem.yaml'
331331
'400':
332332
description: 'invalid input, object invalid'
333333
'401':
@@ -371,7 +371,7 @@ paths:
371371
content:
372372
application/json+problem:
373373
schema:
374-
$ref: './problem.yaml'
374+
$ref: './problem.yaml'
375375
'400':
376376
description: Bad Request Error
377377
content:
@@ -438,7 +438,7 @@ paths:
438438
content:
439439
application/json+problem:
440440
schema:
441-
$ref: './problem.yaml'
441+
$ref: './problem.yaml'
442442
'400':
443443
description: 'invalid input, object invalid'
444444
'401':
@@ -499,7 +499,7 @@ paths:
499499
schema:
500500
$ref: '#/components/schemas/MediaPatchRequest'
501501
responses:
502-
200:
502+
'200':
503503
description: Media request details
504504
content:
505505
application/json:
@@ -529,7 +529,7 @@ paths:
529529
content:
530530
application/json+problem:
531531
schema:
532-
$ref: './problem.yaml'
532+
$ref: './problem.yaml'
533533
'400':
534534
description: Bad request
535535
content:
@@ -975,27 +975,27 @@ components:
975975
x-enum-varnames: [ USER_NOT_AUTHORISED_FOR_COURTHOUSE, MEDIA_REQUEST_NOT_VALID_FOR_USER ]
976976

977977
AudioRequestsErrorCode:
978-
type: string
979-
enum:
980-
- "AUDIO_REQUESTS_100"
981-
- "AUDIO_REQUESTS_101"
982-
- "AUDIO_REQUESTS_102"
983-
- "AUDIO_REQUESTS_103"
984-
- "AUDIO_REQUESTS_104"
985-
- "AUDIO_REQUESTS_105"
986-
- "AUDIO_REQUESTS_106"
987-
- "AUDIO_REQUESTS_107"
988-
x-enum-varnames: [ MEDIA_REQUEST_NOT_FOUND, MEDIA_REQUEST_NOT_VALID_FOR_USER, MEDIA_REQUEST_TYPE_IS_INVALID_FOR_ENDPOINT, TRANSFORMED_MEDIA_NOT_FOUND, DUPLICATE_MEDIA_REQUEST, USER_NOT_FOUND, INVALID_REQUEST, MAX_HANDHELD_AUDIO_FILES_EXCEEDED ]
978+
type: string
979+
enum:
980+
- "AUDIO_REQUESTS_100"
981+
- "AUDIO_REQUESTS_101"
982+
- "AUDIO_REQUESTS_102"
983+
- "AUDIO_REQUESTS_103"
984+
- "AUDIO_REQUESTS_104"
985+
- "AUDIO_REQUESTS_105"
986+
- "AUDIO_REQUESTS_106"
987+
- "AUDIO_REQUESTS_107"
988+
x-enum-varnames: [ MEDIA_REQUEST_NOT_FOUND, MEDIA_REQUEST_NOT_VALID_FOR_USER, MEDIA_REQUEST_TYPE_IS_INVALID_FOR_ENDPOINT, TRANSFORMED_MEDIA_NOT_FOUND, DUPLICATE_MEDIA_REQUEST, USER_NOT_FOUND, INVALID_REQUEST, MAX_HANDHELD_AUDIO_FILES_EXCEEDED ]
989989

990990
AudioRequestsTitleErrors:
991-
type: string
992-
enum:
993-
- "The requested audio request cannot be found"
994-
- "The audio request is not valid for this user"
995-
- "The audio request is not valid for this action"
996-
- "The requested transformed media cannot be found"
997-
- "An audio request already exists with these properties"
998-
- "Patch media request with user not found"
999-
- "Invalid request"
1000-
- "Max handheld audio files exceed"
1001-
x-enum-varnames: [ MEDIA_REQUEST_NOT_FOUND, MEDIA_REQUEST_NOT_VALID_FOR_USER, MEDIA_REQUEST_TYPE_IS_INVALID_FOR_ENDPOINT, TRANSFORMED_MEDIA_NOT_FOUND, DUPLICATE_MEDIA_REQUEST, USER_NOT_FOUND, INVALID_REQUEST, MAX_HANDHELD_AUDIO_FILES_EXCEEDED]
991+
type: string
992+
enum:
993+
- "The requested audio request cannot be found"
994+
- "The audio request is not valid for this user"
995+
- "The audio request is not valid for this action"
996+
- "The requested transformed media cannot be found"
997+
- "An audio request already exists with these properties"
998+
- "Patch media request with user not found"
999+
- "Invalid request"
1000+
- "Max handheld audio files exceed"
1001+
x-enum-varnames: [ MEDIA_REQUEST_NOT_FOUND, MEDIA_REQUEST_NOT_VALID_FOR_USER, MEDIA_REQUEST_TYPE_IS_INVALID_FOR_ENDPOINT, TRANSFORMED_MEDIA_NOT_FOUND, DUPLICATE_MEDIA_REQUEST, USER_NOT_FOUND, INVALID_REQUEST, MAX_HANDHELD_AUDIO_FILES_EXCEEDED ]

src/main/resources/openapi/retentions.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ paths:
130130
description: "Retention Policy Types"
131131
parameters: [ ]
132132
responses:
133-
"200":
133+
'200':
134134
description: "OK"
135135
content:
136136
application/json:
@@ -251,7 +251,7 @@ paths:
251251
content:
252252
application/json+problem:
253253
schema:
254-
$ref: './problem.yaml'
254+
$ref: './problem.yaml'
255255
'400':
256256
description: "Bad request"
257257
content:
@@ -453,7 +453,7 @@ components:
453453
NO_RETENTION_POLICIES_APPLIED, INTERNAL_SERVER_ERROR, RETENTION_DATE_TOO_LATE, RETENTION_POLICY_TYPE_ID_NOT_FOUND,
454454
NON_UNIQUE_POLICY_NAME, NON_UNIQUE_POLICY_DISPLAY_NAME, DURATION_TOO_SHORT, POLICY_START_MUST_BE_FUTURE,
455455
POLICY_START_DATE_MUST_BE_PAST, NON_UNIQUE_FIXED_POLICY_KEY, FIXED_POLICY_KEY_NOT_FOUND, LIVE_POLICIES_CANNOT_BE_EDITED,
456-
TARGET_POLICY_HAS_PENDING_REVISION, CASE_RETENTION_PASSED]
456+
TARGET_POLICY_HAS_PENDING_REVISION, CASE_RETENTION_PASSED ]
457457

458458
RetentionTitleErrors:
459459
type: string
@@ -481,4 +481,4 @@ components:
481481
NO_RETENTION_POLICIES_APPLIED, INTERNAL_SERVER_ERROR, RETENTION_DATE_TOO_LATE, RETENTION_POLICY_TYPE_ID_NOT_FOUND,
482482
NON_UNIQUE_POLICY_NAME, NON_UNIQUE_POLICY_DISPLAY_NAME, DURATION_TOO_SHORT, POLICY_START_MUST_BE_FUTURE,
483483
POLICY_START_DATE_MUST_BE_PAST, NON_UNIQUE_FIXED_POLICY_KEY, FIXED_POLICY_KEY_NOT_FOUND, LIVE_POLICIES_CANNOT_BE_EDITED,
484-
TARGET_POLICY_HAS_PENDING_REVISION, CASE_RETENTION_PASSED]
484+
TARGET_POLICY_HAS_PENDING_REVISION, CASE_RETENTION_PASSED ]

src/main/resources/openapi/transcriptions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ paths:
363363
schema:
364364
type: integer
365365
format: int64
366+
minimum: 1
366367
responses:
367368
'200':
368369
description: OK

0 commit comments

Comments
 (0)