# info.description
OGCAPI-Styles is a Web API that enables map servers, clients as well as visual style editors, to manage and fetch styles that consist of symbolizing instructions that can be applied by a rendering engine on features and/or coverages.

# info.contact.name
Claudius Ptolomaeus - The Ancient Geographers

# tags[].description
Create, update and delete styles; only for style authors

# tags[].description
Create, update and delete symbols/sprites; only for style authors

# paths./.get.description
The landing page provides links to the API definition, 
the Conformance statements and the available styles.

# paths./.get.responses.200.description
Links to the API capabilities and the style set 
shared by this API.

# paths./.get.responses.406.description
The media types accepted by the client are not 
supported for this resource

# paths./conformance.get.summary
information about conformance classes that this API 
conforms to

# paths./conformance.get.description
List of all conformance classes specified in a specification 
that the server conforms to.

# paths./conformance.get.responses.200.description
the URIs of all conformance classes supported by 
this API

# paths./conformance.get.responses.406.description
The media types accepted by the client are not 
supported for this resource

# paths./styles.get.description
This operation fetches the set of styles available. For
each style the id, a title, links to the stylesheet of
the style in each supported encoding, and the link to the 
metadata is provided.

Testbed-15 only requires support for a small number of the
styles. Therefore, the currently simple approach is sufficient,
but in general the operation should support paging (using a 
parameter `limit` and links to the `next` page in responses).

# paths./styles.get.responses.406.description
The media types accepted by the client are not 
supported for this resource

# paths./styles.post.description
Adds a style to the style repository or just validates
a style.

If the parameter `validate` is set to `yes`, the
style will be validated before adding the style to
the server. If the parameter `validate` is set to 
`only`, the server will not be changed and only the
validation result will be returned.

In case, a new style is created, the following rules
apply.

If the style submitted in the request body includes an
identifier (this depends on the style encoding), that 
identifier will be used. If a style with that identifier 
already exists, an error is returned.

If no identifier can be determined from the submitted 
style, the server will assign a new identifier to the 
style.

A minimal style metadata resource is created at 
`/styles/{styleId}/metadata`. Please update the metadata 
using a PUT request to keep the style metadata consistent 
with the style definition.

The URI of the new style is returned in the header 
`Location`.

This operation is only available to registered style 
authors.

# paths./styles.post.responses.204.description
style validated successfully, no style has been created

# paths./styles/{styleId}.get.description
Fetches the style with identifier `styleId`. The set of 
available styles can be retrieved at `/styles`.

Not all styles are available in all style encodings.

# paths./styles/{styleId}.get.responses.406.description
The requested style encoding is not supported 
for this style

# paths./styles/{styleId}.put.description
Replace an existing style with the id `styleId`. If no 
such style exists, a new style with that id is added.

If the parameter `validate` is set to `yes`, the
style will be validated before adding/updating the 
style. If the parameter `validate` is set to 
`only`, the server will not be changed and only the
validation result will be returned.

For updated styles, the style metadata resource at 
`/styles/{styleId}/metadata` is not updated. 
For new styles a minimal style metadata resource is 
created, too. Please update the metadata using a PUT 
request to keep the style metadata consistent with 
the style definition.

This operation is only available to registered style 
authors.

# paths./styles/{styleId}.put.requestBody.description
A single style in one of the supported style encodings.

# paths./styles/{styleId}.put.responses.204.description
style updated, created or validated successfully

# paths./styles/{styleId}.delete.description
Delete an existing style with the id `styleId`. If no 
such style exists, an error is returned.

Deleting a style also deletes the subordinate resources,
i.e., the style metadata.

This operation is only available to registered style 
authors.

# paths./styles/{styleId}/metadata.get.description
Style metadata is essential information about a style
in order to support users to discover and select styles
for rendering their data and for visual style editors 
to create user interfaces for editing a style.

This operations returns the metadata for the requested
style as a single document.

The stylesheet of the style will typically include some
the metadata, too.

# paths./styles/{styleId}/metadata.put.description
Update the style metadata for the style with the 
id `styleId`. This operation updates the complete
metadata document.

This operation is only available to registered style 
authors.

# paths./styles/{styleId}/metadata.patch.description
Update selected elements of the style metadata for 
the style with the id `styleId`.

The PATCH semantics in this operation are defined by 
RFC 7396 (JSON Merge Patch). From the specification:

_"A JSON merge patch document describes changes to be 
made to a target JSON document using a syntax that 
closely mimics the document being modified. Recipients
of a merge patch document determine the exact set of 
changes being requested by comparing the content of 
the provided patch against the current content of the 
target document. If the provided merge patch contains 
members that do not appear within the target, those 
members are added. If the target does contain the 
member, the value is replaced. Null values in the 
merge patch are given special meaning to indicate 
the removal of existing values in the target."_

Some examples:

To add or update the point of contact, the access
constraint and the revision date, just send

```
{
  "pointOfContact": "Jane Doe"
  "accessConstraints": "restricted"
  "dates": {
    "revision": "2019-05-17T11:46:12Z"
  }
}
```

To remove the point of contact, the access 
constraint and the revision date, send 

```
{
  "pointOfContact": null
  "accessConstraints": null
  "dates": {
    "revision": null
  }
}
```

For arrays the complete array needs to be sent.
To add a keyword to the example style metadata object, send

```
{
  "keywords": [ "basemap", "TDS", "TDS 6.1", "OGC API", "new keyword" ]
}
```

To remove the "TDS" keyword, send

```
{
  "keywords": [ "basemap", "TDS 6.1", "OGC API", "new keyword" ]
}
```

To remove the keywords, send

```
{
  "keywords": null
}
```

The same applies to `stylesheets` and `layers`. To update 
these members, you have to send the complete new array value.

This operation is only available to registered style 
authors.

# paths./styles/{styleId}/metadata.patch.requestBody.description
The members of the style metadata object that are updated.

# paths./styles/{styleId}/metadata.patch.responses.422.description
unprocessable request, the patch document appears 
to be valid, but the server is incapable of processing 
the request

# paths./resources/{resourceId}.get.description
Fetches the resource with identifier `resourceId`. The set of 
available resources can be retrieved at `/resources`.

# paths./resources/{resourceId}.get.responses.406.description
The requested style encoding is not supported 
for this style

# paths./resources/{resourceId}.put.summary
replace a symbol resource or add a new one

# paths./resources/{resourceId}.put.description
Replace an existing resource with the id `resourceId`. If no 
such resource exists, a new resource with that id is added.

A sprite used in a Mapbox Style stylesheet consists of
three resources. Each of the resources needs to be created 
(and eventually deleted) separately.
The PNG bitmap image (resourceId ends in '.png'), the JSON 
index file (resourceId of the same name, but ends in '.json' 
instead of '.png') and the PNG  bitmap image for 
high-resolution displays (the file ends in '.@2x.png').

The resource will only by available in the native format in 
which the resource is posted. There is no support for
automated conversions to other representations.

This operation is only available to registered style 
authors.

# paths./resources/{resourceId}.delete.description
Delete an existing resource with the id `resourceId`. If no 
such resource exists, an error is returned.

This operation is only available to registered style 
authors.

# components.schemas.style-metadata.properties.description.example
This topographic basemap style is designed to be 
used in situations with low ambient light. 

The style supports datasets based on the TDS 6.1
specification.

# components.schemas.landing-page.properties.description.example
Access to data about buildings in the city of Bonn via a Web API that conforms to the OGC API Features specification.

# components.schemas.queryable.properties.id.description
identifier of the attribute that can be used in CQL filters

# components.parameters.f-html-json.description
(informative) \
The content type of the response. If no value is provided, 
the standard http rules apply, i.e., the accept header 
will be used to determine the format.

# components.parameters.f-json.description
(informative) \
The content type of the response. If no value is provided, 
the standard http rules apply, i.e., the accept header 
will be used to determine the format.

# components.parameters.f-style.description
(informative) \
The content type of the response. If no value is provided, 
the standard http rules apply, i.e., the accept header 
will be used to determine the format.

# components.parameters.validate.description
(part of conformance class 'style-validation') \
'yes' creates a new style after successful validation
and returns 400, if validation fails,
'no' creates the style without validation and 
'only' just validates the style without creating a
new style and returns 400, if validation fails,
otherwise 204.

# components.parameters.styleId.description
Local identifier of a style. \
A list of all available styles can be found 
under the /styles path.

# components.parameters.resourceId.description
Local identifier of a symbol resource. \
A list of all available resource can be found 
under the /resources path.