From d72bb0d0952c35de8ca3f8f1e0bd626955855645 Mon Sep 17 00:00:00 2001 From: rautenberg Date: Fri, 12 Jun 2015 15:59:53 +0200 Subject: refine central parameters and responses in swagger API --- api/dataset.json | 74 ++++++++++++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/api/dataset.json b/api/dataset.json index 0eae19e..b7f25a5 100644 --- a/api/dataset.json +++ b/api/dataset.json @@ -47,7 +47,7 @@ { "name": "accept", "in": "header", - "description": "requested Content-type", + "description": "requested Content-Type", "required": true, "type": "string", "enum": [ @@ -96,16 +96,16 @@ "$ref": "#/parameters/subjectid" }, { - "name": "Content-type", + "name": "Content-Type", "in": "header", - "description": "requested Content-type", + "description": "Content-Type", "required": true, "type": "string", "enum": [ + "text/csv", "text/plain", "text/turtle", "application/rdf+xml", - "text/csv", "text/comma-separated-values", "application/vnd.ms-excel", "application/excel", @@ -114,23 +114,11 @@ ] }, { - "name": "file", - "in": "formData", - "description": "data", - "required": false, - "type": "file" + "$ref": "#/parameters/file" } ], "consumes": [ - "text/plain", - "text/turtle", - "application/rdf+xml", - "text/csv", - "text/comma-separated-values", - "application/vnd.ms-excel", - "application/excel", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "application/vnd.oasis.opendocument.spreadsheet" + "multipart/form-data" ], "produces": [ "text/uri-list" @@ -139,6 +127,9 @@ "200": { "$ref": "#/responses/200" }, + "202": { + "$ref": "#/responses/202" + }, "400": { "$ref": "#/responses/400" }, @@ -159,18 +150,10 @@ "description": "Get a list of all datasets", "parameters": [ { - "name": "id", - "in": "path", - "description": "Id of the dataset", - "required": true, - "type": "string" + "$ref": "#/parameters/id" }, { - "name": "subjectid", - "in": "header", - "description": "authorization token if A&A active", - "required": false, - "type": "string" + "$ref": "#/parameters/subjectid" }, { "name": "accept", @@ -250,16 +233,16 @@ "$ref": "#/parameters/id" }, { - "name": "Content-type", + "name": "Content-Type", "in": "header", - "description": "requested Content-type", + "description": "requested Content-Type", "required": true, "type": "string", "enum": [ + "text/csv", "text/plain", "text/turtle", "application/rdf+xml", - "text/csv", "text/comma-separated-values", "application/vnd.ms-excel", "application/excel", @@ -268,23 +251,11 @@ ] }, { - "name": "file", - "in": "formData", - "description": "data", - "required": false, - "type": "file" + "$ref": "#/parameters/file" } ], "consumes": [ - "text/plain", - "text/turtle", - "application/rdf+xml", - "text/csv", - "text/comma-separated-values", - "application/vnd.ms-excel", - "application/excel", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "application/vnd.oasis.opendocument.spreadsheet" + "multipart/form-data" ], "produces": [ "text/uri-list" @@ -293,6 +264,9 @@ "200": { "$ref": "#/responses/200" }, + "202": { + "$ref": "#/responses/202" + }, "400": { "$ref": "#/responses/400" }, @@ -465,12 +439,22 @@ "description": "authorization token, required if A&A active", "required": false, "type": "string" + }, + "file": { + "name": "file", + "in": "formData", + "description": "datafile", + "required": true, + "type": "file" } }, "responses": { "200": { "description": "OK" }, + "202": { + "description": "Accepted" + }, "400": { "description": "Bad Request" }, -- cgit v1.2.3