From bc3c190039549b40e1370f9b7f6c6d3a67b94b33 Mon Sep 17 00:00:00 2001 From: Alexander Biryukov Date: Thu, 18 Jul 2019 19:15:10 +0300 Subject: [PATCH] Added playlist schema, required fields --- docs/schema.json | 102 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 4 deletions(-) diff --git a/docs/schema.json b/docs/schema.json index 7305b0531..3d8fa1742 100644 --- a/docs/schema.json +++ b/docs/schema.json @@ -1,11 +1,104 @@ { - "$schema": "http://json-schema.org/schema#", "title": "Youtube-dl JSON output schema", "description": "This schema is produced when youtube-dl -J is invoked", "definitions": { + "single-video": { + "anyOf": [ + { + "required": [ + "formats" + ] + }, + { + "required": [ + "url" + ] + } + ], + "allOf": [ + { + "$ref": "#/definitions/json-output" + }, + { + "$ref": "#/definitions/format" + } + ] + }, + "playlist": { + "type": "object", + "properties": { + "uploader_url": { + "type": [ + "string", + "null" + ] + }, + "uploader": { + "type": [ + "string", + "null" + ] + }, + "extractor_key": { + "type": [ + "string", + "null" + ] + }, + "extractor": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uploader_id": { + "type": [ + "string", + "null" + ] + }, + "webpage_url_basename": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] + }, + "webpage_url": { + "type": [ + "string", + "null" + ] + }, + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/single-video" + } + } + } + }, "json-output": { "type": "object", "id": "urn:jsonschema:youtube-dl-json-output", + "required": [ + "id", + "title" + ], "properties": { "id": { "type": "string", @@ -265,6 +358,7 @@ "playlist_index": { "type": [ "string", + "integer", "null" ] }, @@ -841,12 +935,12 @@ } } }, - "allOf": [ + "anyOf": [ { - "$ref": "#/definitions/json-output" + "$ref": "#/definitions/single-video" }, { - "$ref": "#/definitions/format" + "$ref": "#/definitions/playlist" } ] }