{
    "title": "Goodtables Report",
    "description": "The validation report generated by goodtables.",
    "definitions": {},
    "$schema": "http://json-schema.org/draft-06/schema#",
    "$id": "http://example.com/example.json",
    "type": "object",
    "required": [
        "time",
        "valid",
        "error-count",
        "table-count",
        "preset",
        "warnings"
    ],
    "properties": {
        "time": {
            "type": "number",
            "title": "Time",
            "description": "The overall time it took to run all checks.",
            "minimum": 0
        },
        "valid": {
            "type": "boolean",
            "title": "Valid",
            "description": "The end-result of validating all tables."
        },
        "error-count": {
            "type": "integer",
            "title": "Error count",
            "description": "Number of errors found across all tables.",
            "minimum": 0
        },
        "table-count": {
            "type": "integer",
            "title": "Table count",
            "description": "Number of tables validated.",
            "minimum": 0
        },
        "warnings": {
            "type": "array",
            "title": "Warnings",
            "items": {
                "type": "string",
                "title": "Warning",
                "examples": [
                    "Table \"data.csv\" inspector has reached 10 error(s) limit"
                ]
            }
        },
        "preset": {
            "type": "string",
            "title": "Preset",
            "description": "The preset of the dataset to be validated.",
            "examples": [
                "table",
                "datapackage",
                "nested"
            ]
        },
        "tables": {
            "type": "array",
            "title": "Tables",
            "description": "The validation results for each of the tables.",
            "items": {
                "type": "object",
                "required": [
                    "time",
                    "valid",
                    "error-count",
                    "row-count",
                    "headers",
                    "errors"
                ],
                "properties": {
                    "time": {
                        "type": "number",
                        "title": "Time",
                        "description": "The time it took to validate this table.",
                        "minimum": 0
                    },
                    "valid": {
                        "type": "boolean",
                        "title": "Valid",
                        "description": "The validation result."
                    },
                    "error-count": {
                        "type": "integer",
                        "title": "Error count",
                        "description": "Number of errors found.",
                        "minimum": 0
                    },
                    "row-count": {
                        "type": "integer",
                        "title": "Row count",
                        "description": "Number of rows validated.",
                        "minimum": 0
                    },
                    "source": {
                        "type": [
                            "string",
                            "array"
                        ],
                        "title": "Source",
                        "description": "Path or URI where this table was loaded from."
                    },
                    "headers": {
                        "type": "array",
                        "title": "Headers",
                        "description": "List of table's headers.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scheme": {
                        "type": "string",
                        "title": "Scheme",
                        "description": "The scheme used to load the data.",
                        "examples": [
                            "http",
                            "ftp",
                            "file"
                        ]
                    },
                    "format": {
                        "type": "string",
                        "title": "Format",
                        "description": "The data format.",
                        "examples": [
                            "csv",
                            "ods",
                            "xls"
                        ]
                    },
                    "encoding": {
                        "type": "string",
                        "title": "Encoding",
                        "description": "The encoding of the table.",
                        "examples": [
                            "utf-8",
                            "iso-89951"
                        ]
                    },
                    "schema": {
                        "type": "string",
                        "title": "Schema",
                        "description": "An explanation about the purpose of this instance.",
                        "examples": [
                            "table-schema"
                        ]
                    },
                    "errors": {
                        "type": "array",
                        "title": "Errors",
                        "items": {
                            "type": "object",
                            "required": [
                                "code",
                                "message"
                            ],
                            "properties": {
                                "code": {
                                    "type": "string",
                                    "title": "Code",
                                    "description": "The error code.",
                                    "examples": [
                                        "duplicate-row",
                                        "blank-header"
                                    ]
                                },
                                "row-number": {
                                    "type": "integer",
                                    "title": "Row number",
                                    "description": "The number of the row where the error occurs.",
                                    "minimum": 0
                                },
                                "column-number": {
                                    "type": "integer",
                                    "title": "Column number",
                                    "description": "The number of the column where the error occurs.",
                                    "minimum": 0
                                },
                                "message": {
                                    "type": "string",
                                    "title": "Message",
                                    "description": "The error message."
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}