From d77b16625d75f4fe83103c11d68a313f19959f95 Mon Sep 17 00:00:00 2001 From: Sebastian Brudzinski Date: Mon, 8 May 2017 15:55:28 +0200 Subject: [PATCH] RAML for batch endpoints --- src/main/resources/api-definition.yaml | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/main/resources/api-definition.yaml b/src/main/resources/api-definition.yaml index 9c67862db..a5206950a 100644 --- a/src/main/resources/api-definition.yaml +++ b/src/main/resources/api-definition.yaml @@ -208,6 +208,40 @@ schemas: "items": { "type": "object", "$ref": "schemas/statusMessage.json" } } + - uuidArray: | + { + "type": "array", + "items": { "type": "string", "title": "id" } + } + + - requisitionError: | + { "type": "object", + "$schema": "http://json-schema.org/draft-04/schema", + "title": "RequisitionError", + "description": "A single requisition error", + "properties": { + "error": { "type": "object", "$ref": "#/schemas/localizedMessage" }, + "requisitionId": { "type": "string", "title": "id" } + } + } + + - requisitionErrorArray: | + { + "type": "array", + "items": { "type": "object", "$ref": "#/schemas/requisitionError" } + } + + - requisitionsProcessingStatus: | + { "type": "object", + "$schema": "http://json-schema.org/draft-04/schema", + "title": "RequisitionsProcessingStatus", + "description": "An array of all requsitions that have been processed successfully and an array of errors.", + "properties": { + "requisitions": { "type": "object", "$ref": "#/schemas/requisitionDtoArray" }, + "errors": { "type": "object", "$ref": "#/schemas/requisitionErrorArray" } + } + } + traits: - secured: queryParameters: @@ -480,6 +514,38 @@ resourceTypes: body: application/json: schema: localizedMessage + /approve: + post: + is: [ secured ] + body: + application/json: + schema: uuidArray + description: Attempts to approve requisitions with UUIDs provided in the request body. It always processes all the requisitions and returns an array of requisitions that have been approved successfully and an array of error messages. + responses: + "200": + body: + application/json: + schema: requisitionsProcessingStatus + "403": + body: + application/json: + schema: localizedMessage + /save: + put: + is: [ secured ] + body: + application/json: + schema: requisitionDtoArray + description: Saves requisitions with the UUIDs provided in the request body. It always processes all the requisitions and returns an array of requisitions that have been saved successfully and an array of error messages. + responses: + "200": + body: + application/json: + schema: requisitionsProcessingStatus + "403": + body: + application/json: + schema: localizedMessage /{id}/print: uriParameters: id: