Skip to content

Commit 3dd69f9

Browse files
JOBSBATCH-213 Partially fixed Batch docs (#255)
* JOBSBATCH-213 #251 #252 Partially fixed warnings in the Batch API * JOBSBATCH-213 #251 #252 Fixed warnings in the Batch API --------- Co-authored-by: Loparev <[email protected]>
1 parent 89d0277 commit 3dd69f9

File tree

4 files changed

+72
-54
lines changed

4 files changed

+72
-54
lines changed

spec/api_common.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ components:
5353
type: string
5454
enum:
5555
- SUCCESS
56+
- ACCEPTED
5657
description: Indicates whether the response was successful or what error has occurred.
5758

5859
EmptyResponse:
@@ -69,6 +70,22 @@ components:
6970
type: object
7071
type: object
7172

73+
NotEmptyResponse:
74+
type: object
75+
required:
76+
- response
77+
properties:
78+
response:
79+
allOf:
80+
- $ref: '#/components/schemas/SuccessResponse'
81+
- properties:
82+
data:
83+
properties:
84+
message:
85+
type: string
86+
type: object
87+
type: object
88+
7289
Error:
7390
type: object
7491
properties:

spec/job_batches_v1/job_batches_endpoints.yaml

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ x-paths:
5050
response:
5151
code: VALIDATION_ERROR
5252
errors:
53-
key: job.not.found
54-
message: >-
55-
Job {translationJobUid} not found for project {projectId}.
53+
- key: job.not.found
54+
message: >-
55+
Job {translationJobUid} not found for project {projectId}.
5656
400:
5757
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
5858
401:
@@ -144,18 +144,18 @@ x-paths:
144144
code: SUCCESS
145145
data:
146146
items:
147-
- authorized: 'true'
147+
- authorized: true
148148
batchUid: 559ce40f2789
149149
createdDate: '2015-11-21T11:51:17Z'
150-
hasError: 'false'
150+
hasError: false
151151
modifiedDate: '2015-11-21T11:51:17Z'
152152
projectId: asf53fds34
153153
status: DRAFT
154154
translationJobUid: 635gf40f9846
155-
- authorized: 'true'
155+
- authorized: true
156156
batchUid: 456dv32d0934
157157
createdDate: '2015-11-21T11:51:17Z'
158-
hasError: 'false'
158+
hasError: false
159159
modifiedDate: '2015-11-22T10:24:14Z'
160160
projectId: asf53fds34
161161
status: EXECUTING
@@ -210,9 +210,9 @@ x-paths:
210210
response:
211211
value:
212212
response:
213-
code: OK
213+
code: SUCCESS
214214
data:
215-
authorized: 'true'
215+
authorized: true
216216
files:
217217
- errors: ''
218218
fileUri: files/example1.json
@@ -253,10 +253,10 @@ x-paths:
253253
response:
254254
code: VALIDATION_ERROR
255255
errors:
256-
key: batch.not.found
257-
message: >-
258-
Batch with uid={batchUid} and projectId={projectId}
259-
not found.
256+
- key: batch.not.found
257+
message: >-
258+
Batch with uid={batchUid} and projectId={projectId}
259+
not found.
260260
400:
261261
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
262262
401:
@@ -326,10 +326,10 @@ x-paths:
326326
response:
327327
code: VALIDATION_ERROR
328328
errors:
329-
key: batch.not.found
330-
message: >-
331-
Batch with uid={batchUid} and projectId={projectId}
332-
not found.
329+
- key: batch.not.found
330+
message: >-
331+
Batch with uid={batchUid} and projectId={projectId}
332+
not found.
333333
400:
334334
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
335335
401:
@@ -504,12 +504,12 @@ x-paths:
504504
content:
505505
application/json:
506506
schema:
507-
$ref: '../openapi.yaml#/components/schemas/FilesAPIUploadAcceptedResponse'
507+
$ref: '../api_common.yaml#/components/schemas/NotEmptyResponse'
508508
examples:
509509
response:
510510
value:
511511
response:
512-
code: SUCCESS
512+
code: ACCEPTED
513513
data:
514514
message: >-
515515
Your file was successfully uploaded. Word and string
@@ -526,10 +526,10 @@ x-paths:
526526
response:
527527
code: VALIDATION_ERROR
528528
errors:
529-
key: batch.not.found
530-
message: >-
531-
Batch with uid={batchUid} and projectId={projectId}
532-
not found.
529+
- key: batch.not.found
530+
message: >-
531+
Batch with uid={batchUid} and projectId={projectId}
532+
not found.
533533
400:
534534
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
535535
401:
@@ -548,10 +548,10 @@ x-paths:
548548
response:
549549
code: RESOURCE_LOCKED
550550
errors:
551-
key: resource.locked
552-
message: >-
553-
The file is currently being processed and will be
554-
available in a few minutes.
551+
- key: resource.locked
552+
message: >-
553+
The file is currently being processed and will be
554+
available in a few minutes.
555555
429:
556556
$ref: '../api_common.yaml#/components/responses/Error429ResponseDefinition'
557557
500:
@@ -736,7 +736,6 @@ x-paths:
736736
value:
737737
response:
738738
code: ACCEPTED
739-
data:
740739
404:
741740
description: Batch provided in path is not found
742741
content:
@@ -749,10 +748,10 @@ x-paths:
749748
response:
750749
code: VALIDATION_ERROR
751750
errors:
752-
key: batch.not.found
753-
message: >-
754-
Batch with uid={batchUid} and projectId={projectId}
755-
not found.
751+
- key: batch.not.found
752+
message: >-
753+
Batch with uid={batchUid} and projectId={projectId}
754+
not found.
756755
429:
757756
$ref: '../api_common.yaml#/components/responses/Error429ResponseDefinition'
758757
400:

spec/job_batches_v2/job_batches_endpoints.yaml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ x-paths:
5151
response:
5252
code: VALIDATION_ERROR
5353
errors:
54-
key: job.not.found
55-
message: >-
56-
Job {translationJobUid} not found for project {projectId}.
54+
- key: job.not.found
55+
message: >-
56+
Job {translationJobUid} not found for project {projectId}.
5757
400:
5858
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
5959
401:
@@ -145,18 +145,18 @@ x-paths:
145145
code: SUCCESS
146146
data:
147147
items:
148-
- authorized: 'true'
148+
- authorized: true
149149
batchUid: 559ce40f2789
150150
createdDate: '2015-11-21T11:51:17Z'
151-
hasError: 'false'
151+
hasError: false
152152
modifiedDate: '2015-11-21T11:51:17Z'
153153
projectId: asf53fds34
154154
status: DRAFT
155155
translationJobUid: 635gf40f9846
156-
- authorized: 'true'
156+
- authorized: true
157157
batchUid: 456dv32d0934
158158
createdDate: '2015-11-21T11:51:17Z'
159-
hasError: 'false'
159+
hasError: false
160160
modifiedDate: '2015-11-22T10:24:14Z'
161161
projectId: asf53fds34
162162
status: EXECUTING
@@ -212,9 +212,9 @@ x-paths:
212212
response:
213213
value:
214214
response:
215-
code: OK
215+
code: SUCCESS
216216
data:
217-
authorized: 'true'
217+
authorized: true
218218
files:
219219
- errors: ''
220220
fileUri: files/example1.json
@@ -251,10 +251,10 @@ x-paths:
251251
response:
252252
code: VALIDATION_ERROR
253253
errors:
254-
key: batch.not.found
255-
message: >-
256-
Batch with uid={batchUid} and projectId={projectId}
257-
not found.
254+
- key: batch.not.found
255+
message: >-
256+
Batch with uid={batchUid} and projectId={projectId}
257+
not found.
258258
400:
259259
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
260260
401:
@@ -321,10 +321,10 @@ x-paths:
321321
response:
322322
code: VALIDATION_ERROR
323323
errors:
324-
key: batch.not.found
325-
message: >-
326-
Batch with uid={batchUid} and projectId={projectId}
327-
not found.
324+
- key: batch.not.found
325+
message: >-
326+
Batch with uid={batchUid} and projectId={projectId}
327+
not found.
328328
400:
329329
$ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition'
330330
401:
@@ -513,7 +513,6 @@ x-paths:
513513
value:
514514
response:
515515
code: ACCEPTED
516-
data:
517516
404:
518517
description: Batch provided in path is not found
519518
content:
@@ -526,10 +525,10 @@ x-paths:
526525
response:
527526
code: VALIDATION_ERROR
528527
errors:
529-
key: batch.not.found
530-
message: >-
531-
Batch with uid={batchUid} and projectId={projectId}
532-
not found.
528+
- key: batch.not.found
529+
message: >-
530+
Batch with uid={batchUid} and projectId={projectId}
531+
not found.
533532
429:
534533
$ref: '../api_common.yaml#/components/responses/Error429ResponseDefinition'
535534
400:

spec/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9855,6 +9855,9 @@ components:
98559855
example: '2015-11-21T01:51:17.000Z'
98569856
format: date-time
98579857
type: string
9858+
hasError:
9859+
description: The flag showing if this Batch has at least one error
9860+
type: boolean
98589861
type: object
98599862
BatchItemV1:
98609863
description: Associates an uploaded file with particular Batch. BatchItem is handled

0 commit comments

Comments
 (0)