{
    "description": "Schema for an array of recovery scenarios",
    "items": {
        "anyOf": [
            {
                "additionalProperties": false,
                "properties": {
                    "error": {
                        "description": "Error filter used to discriminate the bad rows that will be affected by this recovery scenario",
                        "type": "string"
                    },
                    "name": {
                        "description": "The PassThrough recovery scenario doesn't modify the payload",
                        "enum": [
                            "PassThrough"
                        ]
                    }
                },
                "required": [
                    "name",
                    "error"
                ]
            },
            {
                "additionalProperties": false,
                "properties": {
                    "error": {
                        "description": "Error filter used to discriminate the bad rows that will be affected by this recovery scenario",
                        "type": "string"
                    },
                    "name": {
                        "description": "The RemoveFrom{Body,QueryString} will remove part of the payload",
                        "enum": [
                            "RemoveFromQueryString",
                            "RemoveFromBody"
                        ]
                    },
                    "toRemove": {
                        "description": "String or regex to remove from the {body, query string}",
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "error",
                    "toRemove"
                ]
            },
            {
                "additionalProperties": false,
                "properties": {
                    "error": {
                        "description": "Error filter used to discriminate the bad rows that will be affected by this recovery scenario",
                        "type": "string"
                    },
                    "name": {
                        "description": "The ReplaceIn{Body,QueryString} will replace part of the payload",
                        "enum": [
                            "ReplaceInQueryString",
                            "ReplaceInBody"
                        ]
                    },
                    "replacement": {
                        "description": "Replacement for the {body, query string}",
                        "type": "string"
                    },
                    "toReplace": {
                        "description": "String or regex to replace in the {body, query string}",
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "error",
                    "toReplace",
                    "replacement"
                ]
            },
            {
                "additionalProperties": false,
                "properties": {
                    "base64Field": {
                        "description": "Name of the base64-encoded field to decoded and do a replacement in",
                        "enum": [
                            "ue_px",
                            "cx"
                        ]
                    },
                    "error": {
                        "description": "Error filter used to discriminate the bad rows that will be affected by this recovery scenario",
                        "type": "string"
                    },
                    "name": {
                        "description": "The ReplaceInBase64FieldIn{Body,QueryString} will replace part of a base64-encoded field",
                        "enum": [
                            "ReplaceInBase64FieldInQueryString",
                            "ReplaceInBase64FieldInBody"
                        ]
                    },
                    "replacement": {
                        "description": "Replacement in the specified base64-encoded field in the {body, query string}",
                        "type": "string"
                    },
                    "toReplace": {
                        "description": "String or regex to replace in the specified base64-encoded field in the {body, query string}",
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "error",
                    "toReplace",
                    "replacement"
                ]
            },
            {
                "additionalProperties": true,
                "properties": {
                    "error": {
                        "description": "Error filter used to discriminate the bad rows that will be affected by this recovery scenario",
                        "type": "string"
                    },
                    "name": {
                        "description": "Fallback for a custom recovery scenario",
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "error"
                ]
            }
        ],
        "description": "Recovery scenario sum type",
        "type": "object"
    },
    "self": {
        "format": "jsonschema",
        "name": "recoveries",
        "vendor": "com.snowplowanalytics.snowplow",
        "version": "1-0-0"
    },
    "type": "array"
}