{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://apidocs.iqrf.org/openapi/iqrf-gateway-webapp/latest/schemas/timeSet.json",
    "type": "object",
    "title": "Gateway time configuration",
    "examples": [
        {
            "ntpSync": true,
            "ntpServers": [],
            "zoneName": "Europe/Prague"
        }
    ],
    "required": [
        "ntpSync"
    ],
    "additionalProperties": false,
    "properties": {
        "ntpSync": {
            "title": "NTP enabled",
            "description": "NTP time synchronization.",
            "type": "boolean",
            "example": true
        },
        "ntpServers": {
            "title": "NTP servers",
            "description": "Servers to use as authoritative servers when synchronizing time.",
            "type": "array",
            "uniqueItems": true,
            "items": {
                "title": "NTP server",
                "description": "Server IP address or hostname.",
                "anyOf": [
                    {
                        "type": "string",
                        "format": "hostname"
                    },
                    {
                        "type": "string",
                        "format": "ipv4"
                    },
                    {
                        "type": "string",
                        "format": "ipv6"
                    }
                ]
            }
        },
        "zoneName": {
            "title": "Timezone name",
            "description": "Timezone to set.",
            "type": "string",
            "example": "Europe/Prague"
        }
    },
    "if": {
        "properties": {
            "ntpSync": {
                "const": true
            }
        }
    },
    "then": {
        "required": [
            "ntpServers"
        ]
    }
}
