openapi: 3.0.1
info:
  title: Styles server
  contact:
    name: Claudius Ptolomaeus - The Ancient Geographers
    email: claudius.ptolomaeus@gmail.com
  version: 2.18-SNAPSHOT
servers:
- url: http://service.datacove.eu/geoserver/ogc/styles
  description: This server
tags:
- name: Capabilities
  description: Information about this API
- name: Use styles
  description: Discover and fetch styles
- name: Manage styles
  description: Create, update and delete styles; only for style authors
- name: Fetch resources
  description: Fetch symbols/sprites
- name: Manage resources
  description: Create, update and delete symbols/sprites; only for style authors
paths:
  /:
    get:
      tags:
      - Capabilities
      summary: landing page
      description: "The landing page provides links to the API definition, \nthe Conformance\
        \ statements and the available styles."
      operationId: getLandingPage
      parameters:
      - $ref: '#/components/parameters/f-html-json'
      responses:
        "200":
          description: "Links to the API capabilities and the style set \nshared by\
            \ this API."
          content:
            application/x-yaml:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: string
                format: binary
            application/cbor:
              schema:
                type: string
                format: binary
            text/html:
              schema:
                type: string
        "400":
          description: invalid or unknown query parameters
        "406":
          description: "The media types accepted by the client are not \nsupported\
            \ for this resource"
  /conformance:
    get:
      tags:
      - Capabilities
      summary: "information about conformance classes that this API \nconforms to"
      description: "List of all conformance classes specified in a specification \n\
        that the server conforms to."
      operationId: getConformanceClasses
      parameters:
      - $ref: '#/components/parameters/f-json'
      responses:
        "200":
          description: "the URIs of all conformance classes supported by \nthis API"
          content:
            application/x-yaml:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: string
                format: binary
            application/cbor:
              schema:
                type: string
                format: binary
            text/html:
              schema:
                type: string
        "400":
          description: invalid or unknown query parameters
        "406":
          description: "The media types accepted by the client are not \nsupported\
            \ for this resource"
  /styles:
    get:
      tags:
      - Use styles
      summary: information about the available styles
      description: "This operation fetches the set of styles available. For\neach\
        \ style the id, a title, links to the stylesheet of\nthe style in each supported\
        \ encoding, and the link to the \nmetadata is provided.\n\nTestbed-15 only\
        \ requires support for a small number of the\nstyles. Therefore, the currently\
        \ simple approach is sufficient,\nbut in general the operation should support\
        \ paging (using a \nparameter `limit` and links to the `next` page in responses)."
      operationId: getStyleSet
      parameters:
      - $ref: '#/components/parameters/f-json'
      responses:
        "200":
          description: the set of available styles
          content:
            application/x-yaml:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: string
                format: binary
            application/cbor:
              schema:
                type: string
                format: binary
            text/html:
              schema:
                type: string
        "400":
          description: invalid or unknown query parameters
        "406":
          description: "The media types accepted by the client are not \nsupported\
            \ for this resource"
    post:
      tags:
      - Manage styles
      summary: adds a new style
      description: "Adds a style to the style repository or just validates\na style.\n\
        \nIf the parameter `validate` is set to `yes`, the\nstyle will be validated\
        \ before adding the style to\nthe server. If the parameter `validate` is set\
        \ to \n`only`, the server will not be changed and only the\nvalidation result\
        \ will be returned.\n\nIn case, a new style is created, the following rules\n\
        apply.\n\nIf the style submitted in the request body includes an\nidentifier\
        \ (this depends on the style encoding), that \nidentifier will be used. If\
        \ a style with that identifier \nalready exists, an error is returned.\n\n\
        If no identifier can be determined from the submitted \nstyle, the server\
        \ will assign a new identifier to the \nstyle.\n\nA minimal style metadata\
        \ resource is created at \n`/styles/{styleId}/metadata`. Please update the\
        \ metadata \nusing a PUT request to keep the style metadata consistent \n\
        with the style definition.\n\nThe URI of the new style is returned in the\
        \ header \n`Location`.\n\nThis operation is only available to registered style\
        \ \nauthors."
      operationId: addStyle
      parameters:
      - $ref: '#/components/parameters/validate'
      requestBody:
        description: Stylesheet to be added
        content:
          application/vnd.mapbox.style+json:
            schema:
              $ref: '#/components/schemas/mb-style'
          application/vnd.ogc.sld+xml;version=1.0:
            schema:
              $ref: '#/components/schemas/sld-10'
          application/vnd.ogc.sld+xml;version=1.1:
            schema:
              $ref: '#/components/schemas/sld-11'
      responses:
        "201":
          description: style created
          headers:
            Location:
              description: URI of the new style
              schema:
                type: string
        "204":
          description: style validated successfully, no style has been created
        "400":
          description: invalid input, the style is invalid
        "401":
          description: unauthorized access
        "409":
          description: a style with that id already exists
      security:
      - BasicAuth: []
  /styles/{styleId}:
    get:
      tags:
      - Use styles
      summary: fetch a style by id
      description: "Fetches the style with identifier `styleId`. The set of \navailable\
        \ styles can be retrieved at `/styles`.\n\nNot all styles are available in\
        \ all style encodings."
      operationId: getStyle
      parameters:
      - $ref: '#/components/parameters/styleId'
      - $ref: '#/components/parameters/f-style'
      responses:
        "200":
          description: The style
          content:
            application/x-yaml:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                type: string
                format: binary
            application/cbor:
              schema:
                type: string
                format: binary
            text/html:
              schema:
                type: string
        "404":
          description: style not found
        "406":
          description: "The requested style encoding is not supported \nfor this style"
    put:
      tags:
      - Manage styles
      summary: replace a style or add a new style
      description: "Replace an existing style with the id `styleId`. If no \nsuch\
        \ style exists, a new style with that id is added.\n\nIf the parameter `validate`\
        \ is set to `yes`, the\nstyle will be validated before adding/updating the\
        \ \nstyle. If the parameter `validate` is set to \n`only`, the server will\
        \ not be changed and only the\nvalidation result will be returned.\n\nFor\
        \ updated styles, the style metadata resource at \n`/styles/{styleId}/metadata`\
        \ is not updated. \nFor new styles a minimal style metadata resource is \n\
        created, too. Please update the metadata using a PUT \nrequest to keep the\
        \ style metadata consistent with \nthe style definition.\n\nThis operation\
        \ is only available to registered style \nauthors."
      operationId: updateStyle
      parameters:
      - $ref: '#/components/parameters/styleId'
      - $ref: '#/components/parameters/validate'
      requestBody:
        description: A single style in one of the supported style encodings.
        content:
          application/vnd.mapbox.style+json:
            schema:
              $ref: '#/components/schemas/mb-style'
          application/vnd.ogc.sld+xml;version=1.0:
            schema:
              $ref: '#/components/schemas/sld-10'
          application/vnd.ogc.sld+xml;version=1.1:
            schema:
              $ref: '#/components/schemas/sld-11'
      responses:
        "204":
          description: style updated, created or validated successfully
        "400":
          description: invalid input, the style is invalid
        "401":
          description: unauthorized access
      security:
      - BasicAuth: []
    delete:
      tags:
      - Manage styles
      summary: delete a style
      description: "Delete an existing style with the id `styleId`. If no \nsuch style\
        \ exists, an error is returned.\n\nDeleting a style also deletes the subordinate\
        \ resources,\ni.e., the style metadata.\n\nThis operation is only available\
        \ to registered style \nauthors."
      operationId: deleteStyle
      parameters:
      - $ref: '#/components/parameters/styleId'
      responses:
        "204":
          description: style deleted
        "401":
          description: unauthorized access
        "404":
          description: style not found
      security:
      - BasicAuth: []
  /styles/{styleId}/metadata:
    get:
      tags:
      - Use styles
      summary: fetch the metadata about a style
      description: "Style metadata is essential information about a style\nin order\
        \ to support users to discover and select styles\nfor rendering their data\
        \ and for visual style editors \nto create user interfaces for editing a style.\n\
        \nThis operations returns the metadata for the requested\nstyle as a single\
        \ document.\n\nThe stylesheet of the style will typically include some\nthe\
        \ metadata, too."
      operationId: getStyleMetadata
      parameters:
      - $ref: '#/components/parameters/styleId'
      - $ref: '#/components/parameters/f-json'
      responses:
        "200":
          description: The metdata for the style.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/style-metadata'
        "404":
          description: style not found
    put:
      tags:
      - Manage styles
      summary: update the metadata document of a style
      description: "Update the style metadata for the style with the \nid `styleId`.\
        \ This operation updates the complete\nmetadata document.\n\nThis operation\
        \ is only available to registered style \nauthors."
      operationId: updateStyleMetadata
      parameters:
      - $ref: '#/components/parameters/styleId'
      requestBody:
        description: The metadata of a style.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/style-metadata'
      responses:
        "204":
          description: style metadata updated
        "401":
          description: unauthorized access
        "404":
          description: style not found
      security:
      - BasicAuth: []
    patch:
      tags:
      - Manage styles
      summary: update parts of the style metadata
      description: "Update selected elements of the style metadata for \nthe style\
        \ with the id `styleId`.\n\nThe PATCH semantics in this operation are defined\
        \ by \nRFC 7396 (JSON Merge Patch). From the specification:\n\n_\"A JSON merge\
        \ patch document describes changes to be \nmade to a target JSON document\
        \ using a syntax that \nclosely mimics the document being modified. Recipients\n\
        of a merge patch document determine the exact set of \nchanges being requested\
        \ by comparing the content of \nthe provided patch against the current content\
        \ of the \ntarget document. If the provided merge patch contains \nmembers\
        \ that do not appear within the target, those \nmembers are added. If the\
        \ target does contain the \nmember, the value is replaced. Null values in\
        \ the \nmerge patch are given special meaning to indicate \nthe removal of\
        \ existing values in the target.\"_\n\nSome examples:\n\nTo add or update\
        \ the point of contact, the access\nconstraint and the revision date, just\
        \ send\n\n```\n{\n  \"pointOfContact\": \"Jane Doe\"\n  \"accessConstraints\"\
        : \"restricted\"\n  \"dates\": {\n    \"revision\": \"2019-05-17T11:46:12Z\"\
        \n  }\n}\n```\n\nTo remove the point of contact, the access \nconstraint and\
        \ the revision date, send \n\n```\n{\n  \"pointOfContact\": null\n  \"accessConstraints\"\
        : null\n  \"dates\": {\n    \"revision\": null\n  }\n}\n```\n\nFor arrays\
        \ the complete array needs to be sent.\nTo add a keyword to the example style\
        \ metadata object, send\n\n```\n{\n  \"keywords\": [ \"basemap\", \"TDS\"\
        , \"TDS 6.1\", \"OGC API\", \"new keyword\" ]\n}\n```\n\nTo remove the \"\
        TDS\" keyword, send\n\n```\n{\n  \"keywords\": [ \"basemap\", \"TDS 6.1\"\
        , \"OGC API\", \"new keyword\" ]\n}\n```\n\nTo remove the keywords, send\n\
        \n```\n{\n  \"keywords\": null\n}\n```\n\nThe same applies to `stylesheets`\
        \ and `layers`. To update \nthese members, you have to send the complete new\
        \ array value.\n\nThis operation is only available to registered style \n\
        authors."
      operationId: patchStyleMetadata
      parameters:
      - $ref: '#/components/parameters/styleId'
      requestBody:
        description: The members of the style metadata object that are updated.
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/style-metadata'
      responses:
        "204":
          description: style metadata updated
        "400":
          description: malformed patch document
        "401":
          description: unauthorized access
        "404":
          description: style not found
        "415":
          description: unsupported patch document
          headers:
            Accept-Patch:
              description: supported patch document media types
              schema:
                type: string
        "422":
          description: "unprocessable request, the patch document appears \nto be\
            \ valid, but the server is incapable of processing \nthe request"
      security:
      - BasicAuth: []
  /resources/{resourceId}:
    get:
      tags:
      - Fetch resources
      summary: fetch a symbol resource by id
      description: "Fetches the resource with identifier `resourceId`. The set of\
        \ \navailable resources can be retrieved at `/resources`."
      operationId: getResource
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        "200":
          description: The symbol resource
          content:
            image/png:
              schema:
                $ref: '#/components/schemas/bitmap'
            image/svg+xml:
              schema:
                $ref: '#/components/schemas/svg'
            application/json:
              schema:
                $ref: '#/components/schemas/mb-sprite-index'
        "404":
          description: resource not found
        "406":
          description: "The requested style encoding is not supported \nfor this style"
    put:
      tags:
      - Manage resources
      summary: replace a symbol resource or add a new one
      description: "Replace an existing resource with the id `resourceId`. If no \n\
        such resource exists, a new resource with that id is added.\n\nA sprite used\
        \ in a Mapbox Style stylesheet consists of\nthree resources. Each of the resources\
        \ needs to be created \n(and eventually deleted) separately.\nThe PNG bitmap\
        \ image (resourceId ends in '.png'), the JSON \nindex file (resourceId of\
        \ the same name, but ends in '.json' \ninstead of '.png') and the PNG  bitmap\
        \ image for \nhigh-resolution displays (the file ends in '.@2x.png').\n\n\
        The resource will only by available in the native format in \nwhich the resource\
        \ is posted. There is no support for\nautomated conversions to other representations.\n\
        \nThis operation is only available to registered style \nauthors."
      operationId: updateResource
      parameters:
      - $ref: '#/components/parameters/resourceId'
      requestBody:
        description: A single symbol or sprite resource.
        content:
          image/png:
            schema:
              $ref: '#/components/schemas/bitmap'
          image/svg+xml:
            schema:
              $ref: '#/components/schemas/svg'
          application/json:
            schema:
              $ref: '#/components/schemas/mb-sprite-index'
      responses:
        "204":
          description: symbol resource updated or created
        "401":
          description: unauthorized access
      security:
      - BasicAuth: []
    delete:
      tags:
      - Manage resources
      summary: delete a symbol resource
      description: "Delete an existing resource with the id `resourceId`. If no \n\
        such resource exists, an error is returned.\n\nThis operation is only available\
        \ to registered style \nauthors."
      operationId: deleteResource
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        "204":
          description: symbol resource deleted
        "401":
          description: unauthorized access
        "404":
          description: resource not found
      security:
      - BasicAuth: []
components:
  schemas:
    mb-style:
      required:
      - layers
      - sources
      - version
      type: object
      properties:
        version:
          type: number
          example: 8
        name:
          type: string
          example: night
        sources:
          type: object
          properties:
            daraa:
              type: object
              properties:
                type:
                  type: string
                  example: vector
                url:
                  type: string
                  example: https://services.interactive-instruments.de/vtp/daraa/tiles/default/{z}/{y}/{x}?f=mvt
        sprite:
          type: string
          example: http://vtp2018.s3-eu-west-1.amazonaws.com/static/mapstorestyle/sprites/sprites
        glyphs:
          type: string
          example: http://fonts.openmaptiles.org/{fontstack}/{range}.pbf
        layers:
          type: array
          items:
            $ref: '#/components/schemas/layers-array'
    layers-array:
      required:
      - id
      - type
      type: object
      properties:
        id:
          type: string
          example: "1"
        type:
          type: string
          example: fill
          enum:
          - fill
          - line
          - symbol
          - circle
          - heatmap
          - fill-extrusion
          - raster
          - hillshade
          - background
        source:
          type: string
          example: daraa
        source-layer:
          type: string
          example: vegetationsrf
        layout:
          type: object
        paint:
          type: object
          properties:
            fill-color:
              type: string
              example: '#11083b'
    mb-sprite-index:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/mb-sprite-index-symbol'
    mb-sprite-index-symbol:
      required:
      - height
      - pixelRatio
      - width
      - x
      - "y"
      type: object
      properties:
        width:
          type: integer
          example: 32
        height:
          type: integer
          example: 32
        x:
          type: integer
          example: 0
        y:
          type: integer
          example: 0
        pixelRatio:
          type: number
          example: 1
    sld-10:
      type: string
    sld-11:
      type: string
    svg:
      type: string
    bitmap:
      type: string
      format: binary
      example: M-^IPNG^M^Z^@^@^@^MIHDR^@^@^@^C^@^@^@^C^H^B^@^@^@?J"?^@^@^@  pHYs^@^@^K^R^@^@^K^R^A??~?^@^@^@^PIDATxM-^\cM-^X??^OA^LXX^@?^O1M-^K??A^@^@^@^@IEND?B`M-^B
    resource-set:
      required:
      - resources
      type: object
      properties:
        resources:
          type: array
          example:
          - id: sprite.json
            link:
              href: sprite.json
              type: application/json
              rel: ???
          - id: sprite.png
            link:
              href: sprite.png
              type: image/png
              rel: ???
          - id: sprite.@2x.png
            link:
              href: sprite.@2x.png
              type: image/png
              rel: ???
          - id: mosque.svg
            link:
              href: mosque.svg
              type: image/svg+xml
              rel: ???
          items:
            $ref: '#/components/schemas/resource-set-entry'
    resource-set-entry:
      required:
      - id
      type: object
      properties:
        id:
          type: string
        link:
          $ref: https://api.swaggerhub.com/domains/cportele/ogc-api/1.0.0#/components/schemas/link
    style-metadata:
      required:
      - id
      type: object
      properties:
        id:
          type: string
          example: night
        title:
          type: string
          nullable: true
          example: Topographic night style
        description:
          type: string
          nullable: true
          example: "This topographic basemap style is designed to be \nused in situations\
            \ with low ambient light. \n\nThe style supports datasets based on the\
            \ TDS 6.1\nspecification."
        keywords:
          type: array
          nullable: true
          example:
          - basemap
          - TDS
          - TDS 6.1
          - OGC API
          items:
            type: string
        pointOfContact:
          type: string
          nullable: true
          example: John Doe
        accessConstraints:
          type: string
          nullable: true
          example: unclassified
          enum:
          - unclassified
          - confidential
          - restricted
          - secret
          - topSecret
        dates:
          $ref: '#/components/schemas/dates'
        scope:
          type: string
          nullable: true
          example: style
          enum:
          - style
        version:
          type: string
          nullable: true
          example: 1.0.0
        stylesheets:
          type: array
          nullable: true
          example:
          - title: Mapbox Style
            version: "8"
            specification: https://docs.mapbox.com/mapbox-gl-js/style-spec/
            native: true
            tilingScheme: GoogleMapsCompatible
            link:
              href: https://example.org/catalog/1.0/styles/night?f=mapbox
              rel: stylesheet
              type: application/vnd.mapbox.style+json
          - title: OGC SLD
            version: "1.0"
            native: false
            link:
              href: https://example.org/catalog/1.0/styles/night?f=sld10
              rel: stylesheet
              type: application/vnd.ogc.sld+xml;version=1.0
          items:
            $ref: '#/components/schemas/stylesheet'
        layers:
          type: array
          nullable: true
          example:
          - id: vegetationsrf
            type: polygon
            sampleData:
              href: https://services.interactive-instruments.de/vtp/daraa/collections/vegetationsrf/items?f=json&limit=100
              rel: data
              type: application/geo+json
          - id: hydrographycrv
            type: line
            sampleData:
              href: https://services.interactive-instruments.de/vtp/daraa/collections/hydrographycrv/items?f=json&limit=100
              rel: data
              type: application/geo+json
            attributes:
            - id: f_code
              type: string
          items:
            $ref: '#/components/schemas/style-layer'
    dates:
      type: object
      properties:
        creation:
          type: string
          format: date-time
          nullable: true
        publication:
          type: string
          format: date-time
          nullable: true
        revision:
          type: string
          format: date-time
          nullable: true
        validTill:
          type: string
          format: date-time
          nullable: true
        receivedOn:
          type: string
          format: date-time
          nullable: true
      nullable: true
      example:
        creation: 2019-01-01T10:05:00Z
        publication: 2019-01-01T11:05:00Z
        revision: 2019-02-01T11:05:00Z
        validTill: 2019-02-01T11:05:00Z
        receivedOn: 2019-02-01T11:05:00Z
    stylesheet:
      required:
      - link
      type: object
      properties:
        title:
          type: string
          nullable: true
        version:
          type: string
          nullable: true
        specification:
          type: string
          format: url
          nullable: true
        native:
          type: boolean
          nullable: true
        tilingScheme:
          type: string
          nullable: true
        link:
          $ref: https://api.swaggerhub.com/domains/cportele/ogc-api/1.0.0#/components/schemas/link
      nullable: true
    style-layer:
      required:
      - id
      type: object
      properties:
        id:
          type: string
          example: vegetationsrf
        description:
          type: string
          nullable: true
        type:
          type: string
          nullable: true
          example: polygon
          enum:
          - point
          - line
          - polygon
          - geometry
          - raster
        attributes:
          $ref: https://api.swaggerhub.com/domains/cportele/ogc-api/1.0.0#/components/schemas/queryables
        sampleData:
          $ref: https://api.swaggerhub.com/domains/cportele/ogc-api/1.0.0#/components/schemas/link
      nullable: true
  parameters:
    f-html-json:
      name: f
      in: query
      description: "(informative) \\\nThe content type of the response. If no value\
        \ is provided, \nthe standard http rules apply, i.e., the accept header \n\
        will be used to determine the format."
      required: false
      style: form
      explode: false
      schema:
        type: string
        enum:
        - json
        - html
      example: json
    f-json:
      name: f
      in: query
      description: "(informative) \\\nThe content type of the response. If no value\
        \ is provided, \nthe standard http rules apply, i.e., the accept header \n\
        will be used to determine the format."
      required: false
      style: form
      explode: false
      schema:
        type: string
        enum:
        - json
      example: json
    f-style:
      name: f
      in: query
      description: "(informative) \\\nThe content type of the response. If no value\
        \ is provided, \nthe standard http rules apply, i.e., the accept header \n\
        will be used to determine the format."
      required: false
      style: form
      explode: false
      schema:
        type: string
        enum:
        - mapbox
        - sld10
        - sld11
      example: mapbox
    validate:
      name: validate
      in: query
      description: "(part of conformance class 'style-validation') \\\n'yes' creates\
        \ a new style after successful validation\nand returns 400, if validation\
        \ fails,\n���no' creates the style without validation and \n'only' just validates\
        \ the style without creating a\nnew style and returns 400, if validation fails,\n\
        otherwise 204."
      required: false
      style: form
      explode: false
      schema:
        type: string
        enum:
        - "yes"
        - "no"
        - only
      example: only
    styleId:
      name: styleId
      in: path
      description: "Local identifier of a style. \\\nA list of all available styles\
        \ can be found \nunder the /styles path."
      required: true
      schema:
        type: string
        enum:
        - polygon
        - cite_lakes
        - poi
        - point
        - suv:polygon_suv
        - grass
        - raster
        - line
        - population
        - dem
        - simple_roads
        - rain
        - green
        - poly_landmarks
        - tiger_roads
        - restricted
        - pophatch
        - simple_streams
        - capitals
        - giant_polygon
        - burg
        - au:AdministrativeUnit.Default
        - lu:LandUse.ExistingLandUse.Default
        - generic
    resourceId:
      name: resourceId
      in: path
      description: "Local identifier of a symbol resource. \\\nA list of all available\
        \ resource can be found \nunder the /resources path."
      required: true
      schema:
        type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic