{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "https://design.pega.com/schemas/themeDefinition.schema.json",
    "definitions": {
        "leaf-node": {
            "$id": "#leaf-node",
            "type": "object",
            "properties": {
                "$type": {
                    "description": "The type for this property.",
                    "enum": ["literal", "inherited", "computed"]
                },
                "$value": {},
                "$constant": {
                    "description": "Indicates if the property can be re-themed.",
                    "type": "boolean",
                    "default": false
                },
                "$comment": {
                    "description": "An informational comment.",
                    "type": "string"
                }
            },
            "oneOf": [
                {
                    "properties": {
                        "$type": { "const": "literal" },
                        "$value": {
                            "description": "The value for this property."
                        }
                    }
                },
                {
                    "properties": {
                        "$type": { "const": "inherited" },
                        "$value": {
                            "description": "The path to the property this inherits from.",
                            "type": "string",
                            "pattern": "^:?([a-z0-9]+(-[a-z0-9]+)*)+(\\.:?([a-z0-9]+(-[a-z0-9]+)*)+)*$"
                        }
                    }
                },
                {
                    "properties": {
                        "$type": { "const": "computed" },
                        "$value": {
                            "description": "Format TBD.",
                            "type": "string"
                        }
                    }
                }
            ],
            "required": ["$type", "$value"],
            "additionalProperties": false
        },
        "other-node": {
            "$id": "#other-node",
            "type": "object",
            "patternProperties": {
                "^:?[a-z0-9]+(-[a-z0-9]+)*$": {
                    "oneOf": [
                        {
                            "$ref": "#/definitions/leaf-node"
                        },
                        {
                            "$ref": "#/definitions/other-node"
                        }
                    ]
                }
            },
            "properties": {
                "$comment": {
                    "description": "An informational comment.",
                    "type": "string"
                }
            },
            "minProperties": 1,
            "additionalProperties": false
        }
    },
    "$ref": "#/definitions/other-node"
}
