{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "validate spider output",
    "description": "validate spider output",
    "type": "object",
    "properties": {
        "_metadata": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "object",
                    "properties": {
                        "code": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "message": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "code",
                        "message"
                    ],
                    "additionalProperties": false
                },
                "crawlTime": {
                    "type": "object",
                    "properties": {
                        "started": {
                            "type": "string"
                        },
                        "durationInMs": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    "required": [
                        "started",
                        "durationInMs"
                    ],
                    "additionalProperties": false
                },
                "spider": {
                    "type": "object",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "version": {
                            "type": "string",
                            "pattern": "^sha256:[a-f0-9]{64}$"
                        }
                    },
                    "required": [
                        "version",
                        "name"
                    ],
                    "additionalProperties": false
                },
                "crawlArgs": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "^sha256:[a-f0-9]{64}$"
                    },
                    "_uniqueItems": false
                }
            },
            "required": [
                "status",
                "crawlTime",
                "spider",
                "crawlArgs"
            ],
            "additionalProperties": false
        },
        "_debug": {
            "type": "object",
            "properties": {
                "crawlLog": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                },
                "chromeDriverLog": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                },
                "screenshot": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                }
            },
            "additionalProperties": false
        }
    },
    "required": [
        "_metadata"
    ],
    "additionalProperties": true
}