{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
        "Warning!": {
            "type": "string"
        },
        "config": {
            "type": "object",
            "propertyNames": {
                "pattern": "^[a-zA-Z0-9_.\\-]+$"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "default": {},
                    "type": {
                        "type": "string"
                    },
                    "section": {
                        "type": "string"
                    },
                    "group": {
                        "type": "string"
                    },
                    "order": {
                        "type": "integer"
                    },
                    "options": {
                        "type": "object"
                    },
                    "units": {
                        "type": "string"
                    },
                    "validate": {
                        "propertyNames": {
                            "pattern": "^value"
                        },
                        "required": ["value"]
                    },
                    "when": {
                        "properties": {
                            "setting": {
                                "type": "string"
                            },
                            "operator": {
                                "type": "string",
                                "enum": [
                                    "equals",
                                    "in"
                                ]
                            },
                            "value": {
                                "type": ["string", "array", "boolean"]
                            }
                        }
                    },
                    "disabled": {
                        "type": "boolean"
                    },
                    "hidden": {
                        "type": "boolean"
                    }
                },
                "required": ["type"],
                "additionalProperties": false,
                "anyOf": [
                    {
                        "properties": {
                            "type": {"const": "select"},
                            "options": {
                                "type": "object",
                                "minProperties": 2
                            }
                        },
                        "required": ["options"]
                    },
                    {
                        "properties": {
                            "type": {"const": "select-dynamic"},
                            "options": {
                                "type": "object",
                                "properties": {
                                    "allowClear": {"type": "boolean"},
                                    "callback": {"type": "string"},
                                    "placeholder": {"type": "string"},
                                    "target": {"type": "string"}
                                },
                                "minProperties": 1,
                                "required": ["target"],
                                "additionalProperties": false
                            },
                            "validate": {
                                "minProperties": 1
                            }
                        },
                        "required": ["options", "validate"]
                    },
                    {
                        "properties": {
                            "type": {"const": "group-role-map"},
                            "options": {
                                "type": "object",
                                "properties": {
                                    "groupPlaceholder": {"type": "string"}
                                },
                                "additionalProperties": false
                            },
                            "validate": {
                                "minProperties": 1
                            }
                        }
                    },
                    {
                        "properties": {
                            "type": {
                                "type": "string",
                                "enum": [
                                    "integer",
                                    "text",
                                    "boolean",
                                    "array",
                                    "array-sub-keyed",
                                    "password",
                                    "email",
                                    "color",
                                    "float",
                                    "graph",
                                    "snmp3auth",
                                    "password-array",
                                    "ad-groups",
                                    "oxidized-maps",
                                    "executable",
                                    "directory"
                                ]
                            }
                        }
                    }
                ],
                "dependencies": {
                    "group": { "required": ["order", "section"] },
                    "order": { "required": ["group", "section"] },
                    "section": { "required": ["group", "order"] }
                }
            }
        }
    },
    "required": ["Warning!", "config"],
    "additionalProperties": false
}
