{
    "$schema": "http://json-schema.org/schema#",
    "title": "ROK4 Server configuration",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "threads": {
            "type": "integer",
            "description": "Threads count to treat requests"
        },
        "port": {
            "type": "string",
            "description": "Port listened"
        },
        "backlog": {
            "type": "integer",
            "description": "Socket's backlog size"
        },
        "enabled": {
            "type": "boolean",
            "description": "Broadcast activation when all configuration is loaded",
            "default": true
        },
        "logger": {
            "type": "object",
            "description": "Logger configuration",
            "additionalProperties": false,
            "properties": {
                "output": {
                    "type": "string",
                    "description": "Output type",
                    "enum": [
                        "standard_output",
                        "static_file",
                        "rolling_file"
                    ]
                },
                "level": {
                    "type": "string",
                    "description": "Log level",
                    "enum": [
                        "fatal",
                        "error",
                        "warn",
                        "info",
                        "debug"
                    ]
                },
                "file_prefix": {
                    "type": "string",
                    "description": "Prefix for log files"
                },
                "file_period": {
                    "type": "integer",
                    "description": "Time limit for a log file (in seconds)"
                }

            }

        },
        "cache": {
            "type": "object",
            "description": "Slab indices cache configuration",
            "additionalProperties": false,
            "properties": {
                "size": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Max items count"
                },
                "validity": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Time to live for an item (in minutes)"
                }
            }
        },
        "configurations": {
            "type": "object",
            "description": "Content configuration",
            "additionalProperties": false,
            "required": ["services", "styles", "tile_matrix_sets"],
            "properties": {
                "services": {
                    "type": "string",
                    "description": "File path to services JSON configuration file"
                },
                "layers": {
                    "type": "string",
                    "description": "Path (file or object) to layers' descriptor list"
                },
                "styles": {
                    "type": "string",
                    "description": "Path (file or object) to styles' directory"
                },
                "tile_matrix_sets": {
                    "type": "string",
                    "description": "Path (file or object) to TMS' directory"
                }
            }
        }        
    }
}