{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swisstopo/json-schema/swisstopo-wmts-response-schema.json",
  "title": "WmtsResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swisstopo-openapi.yml#/components/schemas/WmtsResponse",
  "type": "object",
  "required": [
    "layerId",
    "source"
  ],
  "properties": {
    "layerId": {
      "type": "string",
      "description": "Configured WebMap layer identifier."
    },
    "source": {
      "$ref": "#/$defs/WmtsSource"
    }
  },
  "$defs": {
    "WmtsParameters": {
      "type": "object",
      "required": [
        "layer",
        "matrixSet",
        "format"
      ],
      "properties": {
        "layer": {
          "type": "string",
          "description": "WMTS layer identifier passed to OpenLayers optionsFromCapabilities."
        },
        "style": {
          "type": "string",
          "description": "WMTS style identifier passed to OpenLayers optionsFromCapabilities."
        },
        "matrixSet": {
          "type": "string",
          "description": "Tile matrix set identifier."
        },
        "format": {
          "type": "string",
          "enum": [
            "image/png",
            "image/jpeg"
          ]
        }
      }
    },
    "WmtsSource": {
      "type": "object",
      "required": [
        "urlWMTS",
        "paramsWMTS",
        "serverType",
        "crossOrigin"
      ],
      "properties": {
        "urlWMTS": {
          "type": "string",
          "format": "uri",
          "description": "WMTS capabilities URL used by clients before creating the OpenLayers source."
        },
        "paramsWMTS": {
          "$ref": "#/$defs/WmtsParameters"
        },
        "serverType": {
          "type": "string",
          "enum": [
            "geoserver"
          ]
        },
        "crossOrigin": {
          "type": "string"
        }
      }
    }
  }
}