{
    "format": "json",
    "definitions": {},
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://example.com/root.json",
    "type": "object",
    "title": "Spotify Charts schema",
    "required": [
        "position",
        "id",
        "name",
        "artist",
        "uri",
        "chart_type",
        "recurrence_type",
        "timestamp",
        "report_date",
        "country"
    ],
    "properties": {
        "position": {
            "$id": "#/properties/position",
            "type": "integer",
            "title": "Track position number in chart.",
            "examples": [
                "1", "10"
            ],
            "pattern": "^([\\d]+)$"
        },
        "name": {
            "$id": "#/properties/name",
            "type": "string",
            "title": "Track name.",
            "examples": [
                "We Will Rock You"
            ],
            "pattern": "^(.*)$"
        },
        "id": {
            "$id": "#/properties/id",
            "type": "string",
            "title": "Track ID value.",
            "examples": [
                "3Wrjm47oTz2sjIgck11l5e"
            ],
            "pattern": "^(.*)$"
        },
        "uri": {
            "$id": "#/properties/uri",
            "type": "string",
            "title": "Track URI value.",
            "examples": [
                "https://open.spotify.com/track/3Wrjm47oTz2sjIgck11l5e"
            ],
            "pattern": "^(.*)$"  
        },
        "artist": {
            "$id": "#/properties/artist",
            "type": "string",
            "title": "Track Artist name.",
            "examples": [
                "Michael Jackson"
            ],
            "pattern": "^(.*)$"
        },
        "image_url": {
            "$id": "#/properties/image_url",
            "type": "string",
            "title": "Track image URL.",
            "pattern": "^(.*)$"
        },
        "streams": {
            "$id": "#/properties/streams",
            "type": ["integer", "null"],
            "title": "Track streams in chart.",
            "pattern": "^([\\d]+)$"
        },
        "chart_type": {
            "$id": "#/properties/chart_type",
            "type": "string",
            "title": "Chart type.",
            "enum": [
                "viral",
                "regional"
            ]
        },
        "recurrence_type": {
            "$id": "#/properties/recurrence_type",
            "type": "string",
            "title": "Chart Recurrence type.",
            "enum": [
                "weekly",
                "daily"
            ]
        },
        "timestamp": {
            "$id": "#/properties/timestamp",
            "type": "string",
            "title": "Timestamp.",
            "examples": [
                "2013-06-10T10:30:20"
            ],
            "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}"    
        },
        "report_date": {
            "$id": "#/properties/report_date",
            "type": "string",
            "format": "date",
            "title": "Target date."
        },
        "country": {
            "$id": "#/properties/country",
            "type": "string",
            "title": "Country code.",
            "examples": [
                "JP",
                "AU",
                "global"
            ],
            "pattern": "^(.*)$"
        }
    }
}
