{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://fun.lazying.art/data/schema/fun-media-text-track-v1.schema.json",
  "title": "Fun Lazying Art Text Track v1",
  "type": "object",
  "required": ["schema", "version", "mediaId", "language", "lines"],
  "properties": {
    "schema": {"const": "fun.lazying.media.text-track.v1"},
    "version": {"const": 1},
    "mediaId": {"type": "string"},
    "language": {
      "type": "object",
      "required": ["code", "label", "nativeLabel"],
      "properties": {
        "code": {"type": "string"},
        "label": {"type": "string"},
        "nativeLabel": {"type": "string"},
        "script": {"type": "string"},
        "pronunciation": {"type": "string"}
      }
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "start", "end", "text"],
        "properties": {
          "id": {"type": "string"},
          "start": {"type": "number"},
          "end": {"type": "number"},
          "text": {"type": "string"},
          "singableText": {"type": "string"},
          "role": {"type": "string"},
          "tokens": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["text"],
              "properties": {
                "text": {"type": "string"},
                "start": {"type": "number"},
                "end": {"type": "number"},
                "pinyin": {"type": "string"},
                "display": {"type": "string"},
                "tone": {"type": "integer"},
                "reading": {"type": "string"}
              },
              "additionalProperties": true
            }
          }
        }
      }
    }
  }
}
