---
swagger: '2.0'
info:
version: 1.0.0
title: GeoServer XSLT transforms
description: A transform contains a style sheet that can be used to generate a new textual output format of user choosing for WFS
contact:
name: GeoServer
email: 'geoserver-users@osgeo.org'
url: 'https://geoserver.org/comm/'
host: localhost:8080
basePath: /geoserver/rest
paths:
/services/wfs/transforms:
get:
operationId: getTransforms
tags:
- "Transforms"
summary: List available transformations.
description: Displays a list of all the transforms information available on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/styles.xml" for XML).
produces:
- application/xml
- application/json
- text/html
responses:
200:
description: OK
schema:
$ref: "#/definitions/TransformList"
examples:
application/xml: |
test
test1
application/json: |
{
"transforms": {
"transform": [
{
"name": "test",
"href": "http://localhost:8080/geoserver/restng/services/wfs/transforms/test.json"
},
{
"name": "test1",
"href": "http://localhost:8080/geoserver/restng/services/wfs/transforms/test1.json"
}
]
}
}
post:
operationId: postTransform
tags:
- "Transforms"
summary: Add a new transform
description: Adds a new transform to the server. If the content type used is application/xml the server will assume a definition is being posted, and the XSLT will have to be uploaded separately using a PUT request with content type application/xslt+xml against the transformation resource. If the content type used is application/xslt+xml the server will assume the XSLT itself is being posted, and the name, sourceFormat, outputFormat, outputMimeType query parameters will be used to fill in the transform configuration instead.
parameters:
- name: transformBody
description: Transform body to upload.
in: body
required: true
schema:
$ref: "#/definitions/Transform"
- name: name
in: query
required: false
description: Name of the transformation.
type: string
- name: sourceFormat
in: query
required: false
description: Source format of the transformation.
type: string
- name: outputFormat
in: query
required: false
description: Output format of the transformation.
type: string
- name: outputMimeType
in: query
required: false
description: Output mime type of the transformation.
type: string
- name: fileExtension
in: query
required: false
description: The extension of the file generated by the transformation.
type: string
consumes:
- application/xml
- application/xslt+xml
- application/json
- text/html
responses:
201:
description: Created
put:
operationId: putTransform
tags:
- "Transforms"
description: Invalid. Use POST for adding a new transformation.
responses:
405:
description: Method Not Allowed
delete:
operationId: deleteTransform
tags:
- "Transforms"
description: Invalid.
responses:
405:
description: Method Not Allowed
/services/wfs/transforms/{transform}:
get:
operationId: getTransform
tags:
- "Transforms"
summary: Retrieve a transformation.
description: Retrieves a single transformation.
produces:
- application/xml
- application/xslt+xml
- application/json
- text/html
parameters:
- name: transform
in: path
required: true
description: Name of the transformation.
type: string
responses:
200:
description: OK
schema:
$ref: "#/definitions/Transform"
examples:
application/xml: |
test1
text/xml; subtype=gml/2.1.2
text/html
test1.xslt
application/json: |
{
"transform": {
"name": "test1",
"sourceFormat": "text/xml; subtype=gml/2.1.2",
"outputFormat": "text/html",
"xslt": "test1.xslt"
}
}
application/xslt+xml: |
post:
operationId: postTranform
tags:
- "Transforms"
description: Invalid.
responses:
405:
description: Method Not Allowed
put:
operationId: putTranform
tags:
- "Transforms"
summary: Modify a single transform
description: Modifies a single transform.
parameters:
- name: transformBody
description: Transform body to upload.
in: body
required: true
schema:
$ref: "#/definitions/Transform"
- name: transform
in: path
required: true
description: Name of the transformation.
type: string
consumes:
- application/xml
- application/json
- application/xslt+xml
responses:
200:
description: OK
401:
description: Unauthorized
delete:
operationId: deleteTranform
tags:
- "Transforms"
summary: Delete transformation
description: Deletes a transformation.
parameters:
- name: transform
in: path
required: true
description: Name of the transformation.
type: string
responses:
200:
description: OK
401:
description: Unauthorized
definitions:
TransformList:
title: transforms
type: array
items:
$ref: '#/definitions/TransformListItem'
TransformListItem:
title: transform
type: object
properties:
name:
type: string
description: Name of the transformation
href:
type: string
description: URL to the transformation
Transform:
title: transform
xml:
name: transform
type: object
properties:
name:
type: string
description: Name of the transformation
sourceFormat:
type: string
description: Source format accepted by the transformation
outputFormat:
type: string
description: Output format produced by the transformation
xslt:
type: string
description: Style sheet associated with the transformation