280 lines
6.9 KiB
YAML
280 lines
6.9 KiB
YAML
swagger: "2.0"
|
|
info:
|
|
description: "This is a simple API allowing you to perform XSLT and XPath operations <br>
|
|
Currently we support Xalan and Saxon (libxml2 is in progress) for XSLT and Saxon for XPath"
|
|
version: "0.3"
|
|
title: "XML Tools API"
|
|
host: "gordon.zipper.release11.com:8081"
|
|
schemes:
|
|
- http
|
|
tags:
|
|
- name: "XPath"
|
|
description: "XPath processing API"
|
|
- name: "XSLT"
|
|
description: "XSLT processing API"
|
|
- name: "XSD"
|
|
description: "XSD verification API"
|
|
paths:
|
|
/xpathpost:
|
|
post:
|
|
tags:
|
|
- "XPath"
|
|
summary: "Perform XPath transform on XML file"
|
|
description: ""
|
|
operationId: "xpath"
|
|
consumes:
|
|
- "application/json"
|
|
produces:
|
|
- "application/json"
|
|
parameters:
|
|
- in: "body"
|
|
name: "request"
|
|
description: "A transform that is to be performed"
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/RequestXPath"
|
|
responses:
|
|
"200":
|
|
description: "successful operation"
|
|
schema:
|
|
type: "array"
|
|
items:
|
|
$ref: "#/definitions/Response"
|
|
"400":
|
|
description: "Invalid status value"
|
|
schema:
|
|
type: "array"
|
|
items:
|
|
$ref: "#/definitions/ResponseError"
|
|
/xsltpost:
|
|
post:
|
|
tags:
|
|
- "XSLT"
|
|
summary: "Perform XSLT transform on XML file"
|
|
description: ""
|
|
operationId: "xslt"
|
|
consumes:
|
|
- "application/json"
|
|
produces:
|
|
- "application/json"
|
|
parameters:
|
|
- in: "body"
|
|
name: "request"
|
|
description: "A transform that is to be performed"
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/RequestXSLT"
|
|
responses:
|
|
"200":
|
|
description: "successful operation"
|
|
schema:
|
|
type: "array"
|
|
items:
|
|
$ref: "#/definitions/Response"
|
|
"400":
|
|
description: "Invalid status value"
|
|
schema:
|
|
type: "array"
|
|
items:
|
|
$ref: "#/definitions/ResponseError"
|
|
/xsdpost:
|
|
post:
|
|
tags:
|
|
- "XSD"
|
|
summary: "Verify XML file using XSD"
|
|
description: ""
|
|
operationId: "xsd"
|
|
consumes:
|
|
- "application/json"
|
|
produces:
|
|
- "application/json"
|
|
parameters:
|
|
- in: "body"
|
|
name: "request"
|
|
description: "A XML that is to be verified"
|
|
required: true
|
|
schema:
|
|
$ref: "#/definitions/RequestXSD"
|
|
responses:
|
|
"200":
|
|
description: "successful operation"
|
|
schema:
|
|
type: "array"
|
|
items:
|
|
$ref: "#/definitions/XSDResponse"
|
|
"400":
|
|
description: "Invalid status value"
|
|
schema:
|
|
type: "array"
|
|
items:
|
|
$ref: "#/definitions/XSDError"
|
|
definitions:
|
|
RequestXPath:
|
|
type: "object"
|
|
properties:
|
|
data:
|
|
type: "string"
|
|
example: "<values>
|
|
<value>Test1</value>
|
|
<value>Test3</value>
|
|
</values>"
|
|
description: "The XML data to be processed"
|
|
process:
|
|
type: "string"
|
|
example: "count(//value)"
|
|
description: "XPath tranform to be executed"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "saxon"
|
|
- "xalan"
|
|
version:
|
|
type: "string"
|
|
enum:
|
|
- "2.0"
|
|
- "3.0"
|
|
- "3.1"
|
|
RequestXSLT:
|
|
type: "object"
|
|
properties:
|
|
data:
|
|
type: "string"
|
|
example: "<values>
|
|
<value>Test1</value>
|
|
<value>Test3</value>
|
|
</values>"
|
|
description: "The XML data to be processed"
|
|
process:
|
|
type: "string"
|
|
example: "count(//value)"
|
|
description: "XSLT tranform to be executed"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "saxon"
|
|
- "xalan"
|
|
version:
|
|
type: "string"
|
|
enum:
|
|
- "2.0"
|
|
- "3.0"
|
|
- "3.1"
|
|
RequestXSD:
|
|
type: "object"
|
|
properties:
|
|
data:
|
|
type: "string"
|
|
example: "<shiporder orderid=\"889923\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
|
|
<shipto>
|
|
<name>Ola Nordmann</name>
|
|
<address>Langgt 23</address>
|
|
<city>4000 Stavanger</city>
|
|
<country>Norway</country>
|
|
</shipto>
|
|
</shiporder>"
|
|
description: "The XML data to be processed"
|
|
process:
|
|
type: "string"
|
|
example: "<shiporder orderid=\"889923\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
|
|
<shipto>
|
|
<name>Ola Nordmann</name>
|
|
<address>Langgt 23</address>
|
|
<city>4000 Stavanger</city>
|
|
<country>Norway</country>
|
|
</shipto>
|
|
</shiporder>"
|
|
description: "XSD to perform verification with"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "saxon"
|
|
- "xalan"
|
|
version:
|
|
type: "string"
|
|
enum:
|
|
- "2.0"
|
|
- "3.0"
|
|
- "3.1"
|
|
Response:
|
|
type: "object"
|
|
properties:
|
|
result:
|
|
type: "string"
|
|
example: "4"
|
|
description: "Result of performing transformation on provided XML"
|
|
time:
|
|
type: "string"
|
|
example: "320"
|
|
description: "Computation time in milliseconds"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "Saxon 10.3 2.0 over s9api"
|
|
- "Xalan Java 2.7.2"
|
|
status:
|
|
type: "string"
|
|
enum:
|
|
- "OK"
|
|
ResponseError:
|
|
type: "object"
|
|
properties:
|
|
result:
|
|
type: "string"
|
|
example: "Concatenation operator ('||') requires XPath 3.0 to be enabled"
|
|
description: "Error from XPath processor"
|
|
time:
|
|
type: "string"
|
|
example: "40"
|
|
description: "Computation time in milliseconds"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "Saxon 10.3 2.0 over s9api"
|
|
- "Xalan Java 2.7.2"
|
|
status:
|
|
type: "string"
|
|
enum:
|
|
- "ERR"
|
|
XSDResponse:
|
|
type: "object"
|
|
properties:
|
|
result:
|
|
type: "string"
|
|
example: "XML file is valid"
|
|
description: "Validation result"
|
|
time:
|
|
type: "string"
|
|
example: "7"
|
|
description: "Computation time in milliseconds"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "Xalan Java 2.7.2"
|
|
status:
|
|
type: "string"
|
|
enum:
|
|
- "OK"
|
|
XSDError:
|
|
type: "object"
|
|
properties:
|
|
result:
|
|
type: "string"
|
|
example: "The end-tag for element type \"xs:complexType\" must end with a '>' delimiter."
|
|
description: "Validation result"
|
|
time:
|
|
type: "string"
|
|
example: "7"
|
|
description: "Computation time in milliseconds"
|
|
processor:
|
|
type: "string"
|
|
enum:
|
|
- "Xalan Java 2.7.2"
|
|
status:
|
|
type: "string"
|
|
enum:
|
|
- "ERR"
|
|
|
|
externalDocs:
|
|
description: "Find out more about Swagger"
|
|
url: "http://swagger.io"
|