{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "release",
  "allOf": [{ "$ref": "base" }],
  "properties": {
    "type": { "const": "release" },
    "artist": { "type": "string" },
    "releaseType": { "$ref": "enums#/$defs/releaseType" },
    "releaseDate": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
    "label": { "type": "string" },
    "cover": { "type": "string" },
    "genres": { "type": "array", "items": { "$ref": "enums#/$defs/genre" } },
    "moods": { "type": "array", "items": { "$ref": "enums#/$defs/mood" } },
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["position", "title"],
        "properties": {
          "position": { "type": "integer", "minimum": 1 },
          "title": { "type": "string" },
          "duration": { "type": ["string", "null"] },
          "isrc": { "type": ["string", "null"] },
          "bpm": { "type": ["integer", "null"] },
          "musicalKey": { "$ref": "enums#/$defs/musicalKey" },
          "audio": { "type": ["string", "null"] },
          "video": { "type": ["string", "null"] },
          "poster": { "type": ["string", "null"] },
          "sources": { "$ref": "base#/$defs/sources" }
        }
      }
    },
    "links": { "type": "object", "additionalProperties": { "type": "string" } }
  },
  "required": ["artist", "releaseType", "cover"]
}
