{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Rule validation result",
    "type": "object",
    "properties": {
        "matchedConditions": {
            "description": "List of conditions that matched the event.",
            "type": "array",
            "items": {
                "description": "Condition matching result.",
                "type": "object",
                "properties": {
                    "matchingBy": {
                        "description": "Groups the matching data.",
                        "type": "object",
                        "properties": {
                            "conditionIndex": {
                                "description": "The index of the condition that matches in the conditions rule.",
                                "type": "number"
                            },
                            "source": {
                                "description": "If true, the event source was used to match the event.",
                                "type": "boolean"
                            },
                            "type": {
                                "description": "If true, the event type was used to match the event.",
                                "type": "boolean"
                            },
                            "function": {
                                "description": "If true, the function was used to match the event.",
                                "type": "boolean"
                            }
                        },
                        "required": [
                            "conditionIndex",
                            "source",
                            "type",
                            "function"
                        ]
                    }
                },
                "required": [
                    "matchingBy"
                ]
            },
            "minItems": 1
        },
        "matchedActions": {
            "description": "List of transformations that matched the event.",
            "type": "array",
            "items": {
                "description": "Action matching result.",
                "type": "object",
                "properties": {
                    "matchingBy": {
                        "description": "Groups the matching data.",
                        "type": "object",
                        "properties": {
                            "transformationIndex": {
                                "description": "The index of the transformation that matches in the transformations rule.",
                                "type": "number"
                            },
                            "targetAndType": {
                                "description": "If true, the action target and action type are used to produce the action for the event.",
                                "type": "boolean"
                            }
                        },
                        "required": [
                            "transformationIndex",
                            "targetAndType"
                        ]
                    },
                    "actionBody": {
                        "description": "The event after the transformation was applied. If no transformation function present, the event is returned as it is.",
                        "type": "object"
                    }
                },
                "required": [
                    "matchingBy",
                    "actionBody"
                ]
            },
            "minItems": 1
        }
    },
    "required": [
        "matchedConditions",
        "matchedActions"
    ]
}