diff --git a/spec/api_common.yaml b/spec/api_common.yaml index 3d5fccc3..e70d90cb 100644 --- a/spec/api_common.yaml +++ b/spec/api_common.yaml @@ -53,6 +53,7 @@ components: type: string enum: - SUCCESS + - ACCEPTED description: Indicates whether the response was successful or what error has occurred. EmptyResponse: @@ -69,6 +70,22 @@ components: type: object type: object + NotEmptyResponse: + type: object + required: + - response + properties: + response: + allOf: + - $ref: '#/components/schemas/SuccessResponse' + - properties: + data: + properties: + message: + type: string + type: object + type: object + Error: type: object properties: diff --git a/spec/job_batches_v1/job_batches_endpoints.yaml b/spec/job_batches_v1/job_batches_endpoints.yaml index dc9790e4..724b29be 100644 --- a/spec/job_batches_v1/job_batches_endpoints.yaml +++ b/spec/job_batches_v1/job_batches_endpoints.yaml @@ -50,9 +50,9 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: job.not.found - message: >- - Job {translationJobUid} not found for project {projectId}. + - key: job.not.found + message: >- + Job {translationJobUid} not found for project {projectId}. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -144,18 +144,18 @@ x-paths: code: SUCCESS data: items: - - authorized: 'true' + - authorized: true batchUid: 559ce40f2789 createdDate: '2015-11-21T11:51:17Z' - hasError: 'false' + hasError: false modifiedDate: '2015-11-21T11:51:17Z' projectId: asf53fds34 status: DRAFT translationJobUid: 635gf40f9846 - - authorized: 'true' + - authorized: true batchUid: 456dv32d0934 createdDate: '2015-11-21T11:51:17Z' - hasError: 'false' + hasError: false modifiedDate: '2015-11-22T10:24:14Z' projectId: asf53fds34 status: EXECUTING @@ -210,9 +210,9 @@ x-paths: response: value: response: - code: OK + code: SUCCESS data: - authorized: 'true' + authorized: true files: - errors: '' fileUri: files/example1.json @@ -253,10 +253,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -326,10 +326,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -504,12 +504,12 @@ x-paths: content: application/json: schema: - $ref: '../openapi.yaml#/components/schemas/FilesAPIUploadAcceptedResponse' + $ref: '../api_common.yaml#/components/schemas/NotEmptyResponse' examples: response: value: response: - code: SUCCESS + code: ACCEPTED data: message: >- Your file was successfully uploaded. Word and string @@ -526,10 +526,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -548,10 +548,10 @@ x-paths: response: code: RESOURCE_LOCKED errors: - key: resource.locked - message: >- - The file is currently being processed and will be - available in a few minutes. + - key: resource.locked + message: >- + The file is currently being processed and will be + available in a few minutes. 429: $ref: '../api_common.yaml#/components/responses/Error429ResponseDefinition' 500: @@ -736,7 +736,6 @@ x-paths: value: response: code: ACCEPTED - data: 404: description: Batch provided in path is not found content: @@ -749,10 +748,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 429: $ref: '../api_common.yaml#/components/responses/Error429ResponseDefinition' 400: diff --git a/spec/job_batches_v2/job_batches_endpoints.yaml b/spec/job_batches_v2/job_batches_endpoints.yaml index 7e0dd00a..e1c0ca73 100644 --- a/spec/job_batches_v2/job_batches_endpoints.yaml +++ b/spec/job_batches_v2/job_batches_endpoints.yaml @@ -51,9 +51,9 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: job.not.found - message: >- - Job {translationJobUid} not found for project {projectId}. + - key: job.not.found + message: >- + Job {translationJobUid} not found for project {projectId}. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -145,18 +145,18 @@ x-paths: code: SUCCESS data: items: - - authorized: 'true' + - authorized: true batchUid: 559ce40f2789 createdDate: '2015-11-21T11:51:17Z' - hasError: 'false' + hasError: false modifiedDate: '2015-11-21T11:51:17Z' projectId: asf53fds34 status: DRAFT translationJobUid: 635gf40f9846 - - authorized: 'true' + - authorized: true batchUid: 456dv32d0934 createdDate: '2015-11-21T11:51:17Z' - hasError: 'false' + hasError: false modifiedDate: '2015-11-22T10:24:14Z' projectId: asf53fds34 status: EXECUTING @@ -212,9 +212,9 @@ x-paths: response: value: response: - code: OK + code: SUCCESS data: - authorized: 'true' + authorized: true files: - errors: '' fileUri: files/example1.json @@ -251,10 +251,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -321,10 +321,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 400: $ref: '../api_common.yaml#/components/responses/Error400ResponseDefinition' 401: @@ -513,7 +513,6 @@ x-paths: value: response: code: ACCEPTED - data: 404: description: Batch provided in path is not found content: @@ -526,10 +525,10 @@ x-paths: response: code: VALIDATION_ERROR errors: - key: batch.not.found - message: >- - Batch with uid={batchUid} and projectId={projectId} - not found. + - key: batch.not.found + message: >- + Batch with uid={batchUid} and projectId={projectId} + not found. 429: $ref: '../api_common.yaml#/components/responses/Error429ResponseDefinition' 400: diff --git a/spec/openapi.yaml b/spec/openapi.yaml index 325fd719..69229315 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -9855,6 +9855,9 @@ components: example: '2015-11-21T01:51:17.000Z' format: date-time type: string + hasError: + description: The flag showing if this Batch has at least one error + type: boolean type: object BatchItemV1: description: Associates an uploaded file with particular Batch. BatchItem is handled