{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "http://localhost:8080/standards.json",
    "title": "Standards' requirements summary",
    "description": "Ofqual standard requirements",
    "type": "object",
    "default": {},
    "required": [
        "standards"
    ],
    "properties": {
        "standards": {
            "title": "Standards",
            "description": "List of Ofqual standards",
            "type": "array",
            "default": [],
            "items": {"$ref": "#/$defs/standard"}
        }
    },
    "$defs": {
        "standard": {
            "title": "A summary of an Ofqual standard",
            "type": "object",
            "required": [
                "id",
                "title",
                "url",
                "date",
                "tags",
                "requirements"
            ],
            "properties": {
                "id": {
                    "title": "ID",
                    "description": "A unique ID for the standard",
                    "type": "string",
                    "pattern": "Ofqual-\\d{5}$"
                },
                "title": {
                    "title": "Title",
                    "description": "A short title describing the subject of the standard",
                    "type": "string"
                },
                "url": {
                    "title": "URL",
                    "description": "The url for the standard's documentation on http://localhost:8080/",
                    "type": "string"
                },
                "date": {
                    "title": "Date",
                    "description": "The date this standard was last updated or reviewed formatted as an ISO8601 date",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "tags": {
                    "title": "Tags",
                    "description": "The tags assigned to this standard",
                    "type": "array",
                    "items": {
                        "title": "Tag",
                        "type": "string"
                    }
                },
                "requirements": {
                    "title": "Requirements",
                    "description": "A list of requirements to meet this standard",
                    "type": "array",
                    "items": {"$ref": "#/$defs/requirement"}
                }
            }
        },
        "requirement": {
            "title": "Requirement",
            "description": "A requirement that is part of an Ofqual standard",
            "type": "object",
            "required": [
                "title",
                "id"
            ],
            "properties": {
                "title": {
                    "title": "Title",
                    "description": "A short description of the requirement",
                    "type": "string"
                },
                "id": {
                    "title": "Requirement ID",
                    "description": "The html id of this requirement within the standard's documentation page.",
                    "type": "string"
                }
            }
        }
    }
}
