{
    "additionalProperties": false,
    "description": "Schema for errors reported by Snowplow Event Recovery",
    "properties": {
        "failure": {
            "description": "A reason why payload could not be recovered",
            "properties": {
                "configName": {
                    "description": "Name of recovery configuration that failed",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "error": {
                    "description": "Human-readable error",
                    "type": "string"
                }
            },
            "required": [
                "error"
            ]
        },
        "payload": {
            "description": "Original bad row",
            "properties": {
                "data": {
                    "description": "Original bad row contents",
                    "properties": {
                        "failure": {
                            "description": "Original failure reason(s)",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "payload": {
                            "description": "Original payload object, can be a full payload object or a raw payload string",
                            "type": [
                                "object",
                                "string"
                            ]
                        },
                        "processor": {
                            "description": "Original application that the bad row comes from",
                            "type": "object"
                        }
                    },
                    "required": [
                        "processor",
                        "failure"
                    ],
                    "type": "object"
                },
                "schema": {
                    "description": "Original bad row schema",
                    "enum": [
                        "iglu:com.snowplowanalytics.snowplow.badrows/adapter_failures/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/collector_payload_format_violation/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/enrichment_failures/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/enrichment_failures/jsonschema/2-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/loader_iglu_error/jsonschema/2-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/loader_parsing_error/jsonschema/2-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/loader_recovery_error/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/loader_runtime_error/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/loader_runtime_error/jsonschema/1-0-1",
                        "iglu:com.snowplowanalytics.snowplow.badrows/relay_failure/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/schema_violations/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/schema_violations/jsonschema/2-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/size_violation/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/snowflake_error/jsonschema/1-0-0",
                        "iglu:com.snowplowanalytics.snowplow.badrows/tracker_protocol_violations/jsonschema/1-0-0"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "schema",
                "data"
            ],
            "type": "object"
        },
        "processor": {
            "additionalProperties": false,
            "description": "Information about the piece of software responsible for the creation of enrichment failures",
            "properties": {
                "artifact": {
                    "description": "Artifact responsible for the creation of enrichment failures",
                    "maxLength": 512,
                    "type": "string"
                },
                "version": {
                    "description": "Version of the artifact responsible for the creation of enrichment failures",
                    "maxLength": 32,
                    "pattern": "^(\\d+\\.\\d+\\.\\d+.*)$",
                    "type": "string"
                }
            },
            "required": [
                "artifact",
                "version"
            ],
            "type": "object"
        },
        "recoveries": {
            "description": "Number of times payload recovery has been tried",
            "type": "integer"
        }
    },
    "required": [
        "payload",
        "failure",
        "processor"
    ],
    "self": {
        "format": "jsonschema",
        "name": "recovery_error",
        "vendor": "com.snowplowanalytics.snowplow.badrows",
        "version": "1-0-0"
    },
    "type": "object"
}