{
    "additionalProperties": false,
    "description": "Schema for a format violation bad row",
    "properties": {
        "failure": {
            "additionalProperties": false,
            "description": "Information regarding the format violation",
            "properties": {
                "loader": {
                    "description": "Loader which was used when the failure occurred",
                    "enum": [
                        "clj-tomcat",
                        "cloudfront",
                        "ndjson",
                        "thrift",
                        "tsv"
                    ],
                    "type": "string"
                },
                "message": {
                    "anyOf": [
                        {
                            "additionalProperties": false,
                            "description": "Simple type of error",
                            "properties": {
                                "error": {
                                    "description": "Error which occurred during loading",
                                    "maxLength": 512,
                                    "type": "string"
                                }
                            },
                            "required": [
                                "error"
                            ],
                            "type": "object"
                        },
                        {
                            "additionalProperties": false,
                            "description": "Error when some field did not match the expectations for this loader",
                            "properties": {
                                "expectation": {
                                    "description": "Expectation which was not met",
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                "payloadField": {
                                    "description": "Field which did not meet expectations",
                                    "maxLength": 64,
                                    "type": "string"
                                },
                                "value": {
                                    "description": "Stringified representation of the value which did not meet expectations",
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "payloadField",
                                "expectation"
                            ],
                            "type": "object"
                        }
                    ],
                    "description": "Failure message associated with the format violation",
                    "type": "object"
                },
                "timestamp": {
                    "_format": "date-time",
                    "description": "Timestamp at which the failure occurred",
                    "type": "string"
                }
            },
            "required": [
                "timestamp",
                "loader",
                "message"
            ],
            "type": "object"
        },
        "payload": {
            "description": "The collector payload that resulted in a format violation",
            "type": "string"
        },
        "processor": {
            "additionalProperties": false,
            "description": "Information about the piece of software responsible for the creation of this format violation",
            "properties": {
                "artifact": {
                    "description": "Artifact responsible for the creation of this format violation",
                    "maxLength": 512,
                    "type": "string"
                },
                "version": {
                    "description": "Version of the artifact responsible for the creation of this format violation",
                    "maxLength": 32,
                    "pattern": "^(\\d+\\.\\d+\\.\\d+.*)$",
                    "type": "string"
                }
            },
            "required": [
                "artifact",
                "version"
            ],
            "type": "object"
        }
    },
    "required": [
        "failure",
        "payload",
        "processor"
    ],
    "self": {
        "format": "jsonschema",
        "name": "collector_payload_format_violation",
        "vendor": "com.snowplowanalytics.snowplow.badrows",
        "version": "1-0-0"
    },
    "type": "object"
}