{
  "format": "json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://example.com/root.json",
  "type": "object",
  "title": "Apple Charts schema",
  "required": [
    "position",
    "id",
    "name",
    "artists",
    "artist_name",
    "album_name",
    "timestamp",
    "report_date",
    "release_date",
    "country",
    "isrc",
    "artwork",
    "previews"
  ],
  "properties": {
    "previews": {
      "$id": "#/properties/previews",
      "type": "array",
      "items": {
        "$ref": "#/definitions/Preview"
      }
    },
    "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": [
        "12343232"
      ],
      "pattern": "^(.*)$"
    },
    "isrc": {
      "$id": "#/properties/isrc",
      "type": "string",
      "title": "Track ISRC value.",
      "examples": [
        "USS1Z9900001"
      ],
      "pattern": "^(.*)$"
    },
    "artists": {
      "$id": "#/properties/artists",
      "type": "array",
      "title": "Artists array.",
      "items": {
        "$ref": "#/definitions/Artist"
      }
    },
    "genre_names": {
      "$id": "#/properties/genre_names",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "artist_name": {
      "$id": "#/properties/artist_name",
      "type": "string",
      "pattern": "^(.*)$"
    },
    "album_name": {
      "$id": "#/properties/album_name",
      "type": "string",
      "pattern": "^(.*)$"
    },
    "has_lyrics": {
      "$id": "#/properties/has_lyrics",
      "type": "boolean"
    },
    "url": {
      "$id": "#/properties/url",
      "type": "string",
      "pattern": "^(.*)$"
    },
    "track_number": {
      "$id": "#/properties/track_number",
      "type": "integer"
    },
    "duration_in_millis": {
      "$id": "#/properties/duration_in_millis",
      "type": "integer"
    },
    "disc_number": {
      "$id": "#/properties/disc_number",
      "type": "integer"
    },
    "artwork": {
      "$id": "#/properties/artwork",
      "type": "object",
      "additionalProperties": true,
      "required": [
        "width",
        "height",
        "url"
      ],
      "properties": {
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "url": {
          "type": "string"
        }
      }
    },
    "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": "^(.*)$"
    },
    "release_date": {
      "$id": "#/properties/release_date",
      "type": "string",
      "format": "date",
      "title": "Release date."
    },
    "play_params": {
      "$id": "#/properties/play_params",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        }
      }
    }
  },
  "definitions": {
    "Artist": {
      "title": "Artist object",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string",
          "format": "integer"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ]
    },
    "Preview": {
      "title": "Preview object",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "url": {
          "type": "string"
        }
      }
    }
  }
}
