{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://helpcompare.com/data/schema/comparisons.schema.json",
    "title": "HelpCompare Comparison & Migration Index",
    "description": "Field definitions for https://helpcompare.com/data/comparisons.json: the edge list of the HelpCompare software graph.",
    "type": "object",
    "required": [
        "dataset",
        "license",
        "generated",
        "comparisons",
        "migrations"
    ],
    "properties": {
        "$schema": {
            "type": "string",
            "description": "URL of this JSON Schema.",
            "format": "uri"
        },
        "dataset": {
            "type": "string",
            "description": "Dataset name."
        },
        "description": {
            "type": "string",
            "description": "What the dataset contains."
        },
        "license": {
            "type": "string",
            "description": "Licence URL (CC BY 4.0: reuse freely, credit HelpCompare and link to the source page).",
            "format": "uri"
        },
        "attribution": {
            "type": "string",
            "description": "The credit line to use when reusing the data."
        },
        "generated": {
            "type": "string",
            "description": "When this file was generated (UTC, ISO 8601).",
            "format": "date-time"
        },
        "record_count": {
            "type": "integer",
            "description": "Number of records in the file.",
            "minimum": 0
        },
        "notes": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Plain-English reading notes for the fields."
        },
        "comparisons": {
            "type": "array",
            "description": "Every head-to-head or multi-way comparison.",
            "items": {
                "type": "object",
                "required": [
                    "slug",
                    "title",
                    "url",
                    "tools"
                ],
                "properties": {
                    "slug": {
                        "type": "string",
                        "description": "Page slug."
                    },
                    "title": {
                        "type": "string",
                        "description": "Comparison title."
                    },
                    "url": {
                        "type": "string",
                        "description": "Comparison page.",
                        "format": "uri"
                    },
                    "last_verified": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Date the page was last re-checked against vendor pages; null if not recorded.",
                        "format": "date"
                    },
                    "tools": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Names of the tools compared."
                    }
                }
            }
        },
        "migrations": {
            "type": "array",
            "description": "Every migration guide.",
            "items": {
                "type": "object",
                "required": [
                    "slug",
                    "url",
                    "from",
                    "to"
                ],
                "properties": {
                    "slug": {
                        "type": "string",
                        "description": "Page slug."
                    },
                    "url": {
                        "type": "string",
                        "description": "Migration guide page.",
                        "format": "uri"
                    },
                    "from": {
                        "type": "string",
                        "description": "Tool being left."
                    },
                    "to": {
                        "type": "string",
                        "description": "Tool being moved to."
                    }
                }
            }
        }
    }
}