{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tubearchivist/json-schema/tubearchivist-playlist-schema.json",
  "title": "Playlist",
  "description": "serialize playlist",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tubearchivist-openapi.yml#/components/schemas/Playlist",
  "type": "object",
  "properties": {
    "playlist_active": {
      "type": "boolean"
    },
    "playlist_channel": {
      "type": "string"
    },
    "playlist_channel_id": {
      "type": "string"
    },
    "playlist_description": {
      "type": [
        "string",
        "null"
      ]
    },
    "playlist_entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PlaylistEntry"
      }
    },
    "playlist_id": {
      "type": "string"
    },
    "playlist_last_refresh": {
      "type": "string"
    },
    "playlist_name": {
      "type": "string"
    },
    "playlist_subscribed": {
      "type": "boolean"
    },
    "playlist_sort_order": {
      "$ref": "#/$defs/PlaylistSortOrderEnum"
    },
    "playlist_thumbnail": {
      "type": "string"
    },
    "playlist_type": {
      "$ref": "#/$defs/PlaylistTypeEnum"
    },
    "_index": {
      "type": "string",
      "title": " index"
    },
    "_score": {
      "type": "integer",
      "title": " score"
    }
  },
  "required": [
    "playlist_active",
    "playlist_channel",
    "playlist_channel_id",
    "playlist_entries",
    "playlist_id",
    "playlist_last_refresh",
    "playlist_name",
    "playlist_sort_order",
    "playlist_subscribed",
    "playlist_thumbnail",
    "playlist_type"
  ],
  "$defs": {
    "PlaylistEntry": {
      "type": "object",
      "description": "serialize single playlist entry",
      "properties": {
        "youtube_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "uploader": {
          "type": [
            "string",
            "null"
          ]
        },
        "idx": {
          "type": "integer"
        },
        "downloaded": {
          "type": "boolean"
        }
      },
      "required": [
        "downloaded",
        "idx",
        "title",
        "uploader",
        "youtube_id"
      ]
    },
    "PlaylistSortOrderEnum": {
      "enum": [
        "top",
        "bottom"
      ],
      "type": "string",
      "description": "* `top` - top\n* `bottom` - bottom"
    },
    "PlaylistTypeEnum": {
      "enum": [
        "regular",
        "custom"
      ],
      "type": "string",
      "description": "* `regular` - regular\n* `custom` - custom"
    }
  }
}