{
    "$schema": "http://json-schema.org/schema#",
    "title": "ROK4 Services configuration",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "contact"
    ],
    "properties": {
        "provider": {
            "type": "string",
            "description": "Service provider"
        },
        "site": {
            "type": "string",
            "description": "Provider's website"
        },
        "fee": {
            "type": "string",
            "description": "Access costs"
        },
        "access_constraint": {
            "type": "string",
            "description": "Access conditions"
        },
        "crs_equivalences": {
            "type": "string",
            "description": "Path to JSON file with identical CRS (to avoid useless tranformation)"
        },
        "default_style": {
            "type": "string",
            "description": "Default style internal identifier",
            "default": "normal"
        },
        "contact": {
            "type": "object",
            "additionalProperties": false,
            "description": "Provider's contact informations",
            "properties": {
                "name": {
                    "type": "string"
                },
                "position": {
                    "type": "string"
                },
                "voice": {
                    "type": "string"
                },
                "facsimile": {
                    "type": "string"
                },
                "address_type": {
                    "type": "string"
                },
                "delivery_point": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "administrative_area": {
                    "type": "string"
                },
                "post_code": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                }
            }
        },

        "health": {
            "type": "object",
            "additionalProperties": false,
            "description": "Health API configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Health API activation"
                }
            }
        },

        "admin": {
            "type": "object",
            "additionalProperties": false,
            "description": "Administration API configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Administration API activation"
                }
            }
        },

        "common": {
            "type": "object",
            "additionalProperties": false,
            "description": "Common service configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Common API activation"
                },
                "title": {
                    "type": "string",
                    "description": "Common API title",
                    "default": "COMMON service"
                },
                "abstract": {
                    "type": "string",
                    "description": "Common API abstract",
                    "default": "COMMON service"
                },
                "endpoint_uri": {
                    "type": "string",
                    "description": "Common API public endpoint",
                    "default": "http://localhost/common"
                },
                "root_path": {
                    "type": "string",
                    "description": "Common API internal path",
                    "default": "/common"
                },
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "Common API keywords"
                }
            }
        },

        "wms": {
            "type": "object",
            "additionalProperties": false,
            "description": "WMS API configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "WMS API activation"
                },
                "name": {
                    "type": "string",
                    "description": "WMS API name",
                    "default": "WMS"
                },
                "title": {
                    "type": "string",
                    "description": "WMS API title",
                    "default": "WMS service"
                },
                "abstract": {
                    "type": "string",
                    "description": "WMS API abstract",
                    "default": "WMS service"
                },
                "endpoint_uri": {
                    "type": "string",
                    "description": "WMS API public endpoint",
                    "default": "http://localhost/wms"
                },
                "root_path": {
                    "type": "string",
                    "description": "WMS API internal path",
                    "default": "/wms"
                },
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "WMS API keywords"
                },
                "metadata": {
                    "$ref": "#/$defs/metadata",
                    "description": "WMS service's metadata"
                },
                "reprojection": {
                    "type": "boolean",
                    "default": false,
                    "description": "WMS reprojection activation"
                },
                "inspire": {
                    "type": "boolean",
                    "default": false,
                    "description": "Inspire mode as WMS default response mode activation"
                },
                "formats": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "enum": [
                            "image/jpeg",
                            "image/png",
                            "image/tiff",
                            "image/geotiff",
                            "image/x-bil;bits=32",
                            "text/asc"
                        ]
                    },
                    "description": "WMS handled raster formats",
                    "default": [
                        "image/jpeg",
                        "image/png",
                        "image/tiff",
                        "image/geotiff",
                        "image/x-bil;bits=32"
                    ]
                },
                "root_layer": {
                    "type": "object",
                    "additionalProperties": false,
                    "description": "WMS root layer description",
                    "properties": {
                        "title": {
                            "type": "string",
                            "default": "WMS layers"
                        },
                        "abstract": {
                            "type": "string",
                            "default": "WMS layers"
                        }
                    }
                },
                "limits": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "layers_count": {
                            "type": "integer",
                            "description": "Maximum layers count in a WMS GetMap",
                            "minimum": 1,
                            "default": 1
                        },
                        "width": {
                            "type": "integer",
                            "description": "Maximum width in a WMS GetMap",
                            "minimum": 1,
                            "default": 5000
                        },
                        "height": {
                            "type": "integer",
                            "description": "Maximum height in a WMS GetMap",
                            "minimum": 1,
                            "default": 5000
                        },
                        "tile_x": {
                            "type": "integer",
                            "description": "Maximum source tiles count widthwise to build the response of a WMS GetMap",
                            "minimum": 1,
                            "default": 32
                        },
                        "tile_y": {
                            "type": "integer",
                            "description": "Maximum source tiles count heightwise to build the response of a WMS GetMap",
                            "minimum": 1,
                            "default": 32
                        }
                    }
                },
                "crs": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "WMS global handled CRS"
                }
            }
        },

        "wmts": {
            "type": "object",
            "additionalProperties": false,
            "description": "WMTS API configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "WMTS API activation"
                },
                "title": {
                    "type": "string",
                    "description": "WMTS API title",
                    "default": "WMTS service"
                },
                "abstract": {
                    "type": "string",
                    "description": "WMTS API abstract",
                    "default": "WMTS service"
                },
                "endpoint_uri": {
                    "type": "string",
                    "description": "WMTS API public endpoint",
                    "default": "http://localhost/wmts"
                },
                "root_path": {
                    "type": "string",
                    "description": "WMTS API internal path",
                    "default": "/wmts"
                },
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "WMTS API keywords"
                },
                "metadata": {
                    "$ref": "#/$defs/metadata",
                    "description": "WMTS service's metadata"
                },
                "reprojection": {
                    "type": "boolean",
                    "default": false,
                    "description": "WMTS reprojection activation"
                },
                "inspire": {
                    "type": "boolean",
                    "default": false,
                    "description": "Inspire mode as WMTS default response mode activation"
                }
            }
        },

        "tms": {
            "type": "object",
            "additionalProperties": false,
            "description": "TMS API configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "TMS API activation"
                },
                "title": {
                    "type": "string",
                    "description": "TMS API title",
                    "default": "TMS service"
                },
                "abstract": {
                    "type": "string",
                    "description": "TMS API abstract",
                    "default": "TMS service"
                },
                "endpoint_uri": {
                    "type": "string",
                    "description": "TMS API public endpoint",
                    "default": "http://localhost/tms"
                },
                "root_path": {
                    "type": "string",
                    "description": "TMS API internal path",
                    "default": "/tms"
                },
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "TMS API keywords"
                },
                "metadata": {
                    "$ref": "#/$defs/metadata",
                    "description": "TMS service's metadata"
                }
            }
        },

        "tiles": {
            "type": "object",
            "additionalProperties": false,
            "description": "OGC API Tiles configuration",
            "properties": {
                "enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "OGC API Tiles activation"
                },
                "title": {
                    "type": "string",
                    "description": "OGC API Tiles title",
                    "default": "TMS service"
                },
                "abstract": {
                    "type": "string",
                    "description": "OGC API Tiles abstract",
                    "default": "TMS service"
                },
                "endpoint_uri": {
                    "type": "string",
                    "description": "OGC API Tiles public endpoint",
                    "default": "http://localhost/tiles"
                },
                "root_path": {
                    "type": "string",
                    "description": "OGC API Tiles internal path",
                    "default": "/tiles"
                },
                "keywords": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "description": "OGC API Tiles keywords"
                },
                "metadata": {
                    "$ref": "#/$defs/metadata",
                    "description": "OGC API Tiles service's metadata"
                },
                "reprojection": {
                    "type": "boolean",
                    "default": false,
                    "description": "OGC API Tiles reprojection activation"
                }
            }
        }
    },

    "$defs": {
        "metadata": {
            "type": "object",
            "additionalProperties": false,
            "required": ["format", "type", "url"],
            "properties": {
                "format": {
                    "type": "string",
                    "default": "WMS service"
                },
                "type": {
                    "type": "string",
                    "default": "WMS service"
                },
                "url": {
                    "type": "string",
                    "default": "WMS service"
                }
            }
        }
    }
}