{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "CustomFormatter JSON - SharePoint 2019",
    "description": "CustomFormatter renderer for SharePoint lists - matching with SP2019 version",
    "definitions": {
        "customAction": {
            "type": "object",
            "additionalProperties": false,
            "title": "Action object",
            "description": "Action object for a custom action button",
            "properties": {
                "action": {
                    "description": "Name of the action that the custom action button will execute",
                    "enum": [
                        "defaultClick",
                        "executeFlow"
                    ]
                },
                "actionParams": {
                    "description": "Parameters for the custom action",
                    "anyOf": [
                        {
                            "$ref": "#/definitions/expression"
                        },
                        {
                            "type": "string"
                        }
                    ]
                }
            }
        },
        "expression": {
            "type": "object",
            "additionalProperties": false,
            "title": "Expression object JSON",
            "description": "Expression object for CustomFormatter JSON",
            "properties": {
                "operator": {
                    "description": "Operator for this expression",
                    "enum": [
                        "+",
                        "-",
                        "*",
                        "/",
                        "==",
                        "!=",
                        ">",
                        "<",
                        ">=",
                        "<=",
                        "||",
                        "&&",
                        "?",
                        ":",
                        "toString()",
                        "Number()",
                        "Date()",
                        "cos",
                        "sin"
                    ]
                },
                "operands": {
                    "description": "Operands for this expression",
                    "type": "array",
                    "items": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "number"
                            },
                            {
                                "type": "object",
                                "$ref": "#/definitions/expression"
                            }
                        ]
                    }
                }
            },
            "required": [
                "operator",
                "operands"
            ]
        },
        "elm": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "$schema": {
                    "description": "schema of the JSON",
                    "type": "string"
                },
                "debugMode": {
                    "description": "Is this JSON in debug mode?",
                    "type": "boolean"
                },
                "elmType": {
                    "description": "The type of element to create",
                    "enum": [
                        "div",
                        "button",
                        "span",
                        "a",
                        "img",
                        "svg",
                        "path"
                    ]
                },
                "children": {
                    "description": "Children elements",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "$ref": "#/definitions/elm"
                    }
                },
                "txtContent": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/expression"
                        },
                        {
                            "type": "string"
                        }
                    ]
                },
                "style": {
                    "description": "Specifies the style object for this element",
                    "patternProperties": {
                        "^[a-z]+(?:-[a-z]+)?$": {
                            "description": "Specifies style attributes for this element",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                "customRowAction": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/customAction"
                        }
                    ]
                },
                "attributes": {
                    "type": "object",
                    "description": "Additional attributes to be added to elmType",
                    "properties": {
                        "href": {
                            "description": "Specifies the href attribute",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "src": {
                            "description": "Specifies the src attribute",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "class": {
                            "description": "Specifies the class attribute",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "target": {
                            "description": "Specifies the target attribute, used primarily for <a> element types.",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "role": {
                            "description": "Specifies the role attribute, used accessibility.",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "iconName": {
                            "description": "Specifies the Fabric icon to display before this element",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        },
                        "d": {
                            "description": "Specifies the d attribute. Used primarily for svg path elements",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        }
                    },
                    "patternProperties": {
                        "^aria\\-[a-z]+$": {
                            "description": "Specifies aria- attributes for the element",
                            "anyOf": [
                                {
                                    "$ref": "#/definitions/expression"
                                },
                                {
                                    "type": "string"
                                }
                            ]
                        }
                    },
                    "additionalProperties": false
                }
            },
            "required": [
                "elmType"
            ]
        }
    },
    "$ref": "#/definitions/elm"
}