From 43dcc9fe267abb833418051dc05c2cce50682a11 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 2 Mar 2023 13:28:46 +0100 Subject: [PATCH] Added documentation for new features --- Swagger/swagger.json | 234 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 221 insertions(+), 13 deletions(-) diff --git a/Swagger/swagger.json b/Swagger/swagger.json index 5732422..e38e77b 100644 --- a/Swagger/swagger.json +++ b/Swagger/swagger.json @@ -30,6 +30,10 @@ { "name": "Mocked services", "description": "Mocked services controller" + }, + { + "name": "XML Formatter", + "description": "XML formatting API" } ], "paths": { @@ -38,7 +42,7 @@ "tags": [ "Mocked events" ], - "summary": "filterHistory", + "summary": "Filter History", "operationId": "filterHistoryUsingPOST", "consumes": [ "application/json" @@ -84,7 +88,7 @@ "tags": [ "Mocked events" ], - "summary": "getLastDay", + "summary": "Get last day", "operationId": "getLastDayUsingGET", "produces": [ "*/*" @@ -131,7 +135,7 @@ "tags": [ "Mocked services" ], - "summary": "updateMessage", + "summary": "Update message", "operationId": "updateMessageUsingPUT", "consumes": [ "application/json" @@ -177,7 +181,7 @@ "tags": [ "Mocked services" ], - "summary": "getListOfMessages", + "summary": "Get list of messages", "operationId": "getListOfMessagesUsingGET", "produces": [ "*/*" @@ -218,7 +222,7 @@ "tags": [ "Mocked services" ], - "summary": "getMockedResponse", + "summary": "Get response from mocked service", "operationId": "getMockedResponseUsingGET", "produces": [ "*/*" @@ -300,7 +304,7 @@ "tags": [ "Mocked services" ], - "summary": "getListOfMessages", + "summary": "Get list of messages", "operationId": "getListOfMessagesUsingGET_1", "produces": [ "*/*" @@ -383,7 +387,7 @@ "tags": [ "Mocked services" ], - "summary": "removeMessage", + "summary": "Remove message", "operationId": "removeMessageUsingDELETE", "produces": [ "*/*" @@ -645,6 +649,100 @@ } } } + }, + "/minimize": { + "post": { + "tags": [ + "XML Formatter" + ], + "summary": "Minimize given XML (only libxml)", + "description": "Removes any unneeded whitespace from given xml file", + "operationId": "minimize", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "request", + "description": "A XML to minimize", + "required": true, + "schema": { + "$ref": "#/definitions/RequestPrettify" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MinimizedResponse" + } + } + }, + "400": { + "description": "Invalid status value", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/XSDError" + } + } + } + } + } + }, + "/prettify": { + "post": { + "tags": [ + "XML Formatter" + ], + "summary": "Prettify given XML (only libxml)", + "description": "Removes any unneeded whitespace from given xml file", + "operationId": "minimize", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "request", + "description": "A XML to prettify", + "required": true, + "schema": { + "$ref": "#/definitions/RequestMinimize" + } + } + ], + "responses": { + "200": { + "description": "Successful operation", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MinimizedResponse" + } + } + }, + "400": { + "description": "Invalid status value", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/XSDError" + } + } + } + } + } } }, "definitions": { @@ -794,7 +892,7 @@ "properties": { "data": { "type": "string", - "example": " Test1 Test3 ", + "example": "28", "description": "The XML data to be processed" }, "process": { @@ -824,7 +922,7 @@ "properties": { "data": { "type": "string", - "example": " Test1 Test3 ", + "example": "28", "description": "The XML data to be processed" }, "process": { @@ -854,12 +952,12 @@ "properties": { "data": { "type": "string", - "example": " Ola Nordmann Langgt 23 4000 Stavanger Norway ", + "example": "28", "description": "The XML data to be processed" }, "process": { "type": "string", - "example": " Ola Nordmann Langgt 23 4000 Stavanger Norway ", + "example": " ", "description": "XSD to perform verification with" }, "processor": { @@ -896,7 +994,8 @@ "type": "string", "enum": [ "Saxon 10.3 2.0 over s9api", - "Xalan Java 2.7.2" + "Xalan Java 2.7.2", + "libXml over lxml" ] }, "status": { @@ -924,7 +1023,8 @@ "type": "string", "enum": [ "Saxon 10.3 2.0 over s9api", - "Xalan Java 2.7.2" + "Xalan Java 2.7.2", + "libXml over lxml" ] }, "status": { @@ -988,6 +1088,114 @@ ] } } + }, + "RequestPrettify": { + "type": "object", + "properties": { + "data": { + "type": "string", + "example": "28", + "description": "The XML data to be prettified" + }, + "process": { + "type": "string", + "example": "", + "description": "Unused here, required only to use same json for whole project" + }, + "processor": { + "type": "string", + "enum": [ + "libxml" + ] + }, + "version": { + "type": "string", + "enum": [ + "1.0" + ] + } + } + }, + "RequestMinimize": { + "type": "object", + "properties": { + "data": { + "type": "string", + "example": "28", + "description": "The XML data to be minimized" + }, + "process": { + "type": "string", + "example": "", + "description": "Unused here, required only to use same json for whole project" + }, + "processor": { + "type": "string", + "enum": [ + "libxml" + ] + }, + "version": { + "type": "string", + "enum": [ + "1.0" + ] + } + } + }, + "PrettifiedResponse": { + "type": "object", + "properties": { + "result": { + "type": "string", + "example": "\\n\\t2\\n\\t8\\n", + "description": "Prettified XML" + }, + "time": { + "type": "string", + "example": "320", + "description": "Computation time in milliseconds" + }, + "processor": { + "type": "string", + "enum": [ + "libXml over lxml" + ] + }, + "status": { + "type": "string", + "enum": [ + "OK" + ] + } + } + }, + "MinimizedResponse": { + "type": "object", + "properties": { + "result": { + "type": "string", + "example": "28", + "description": "Result of minimized provided XML" + }, + "time": { + "type": "string", + "example": "320", + "description": "Computation time in milliseconds" + }, + "processor": { + "type": "string", + "enum": [ + "libXml over lxml" + ] + }, + "status": { + "type": "string", + "enum": [ + "OK" + ] + } + } } }, "externalDocs": {