diff --git a/schema/catalog-entry.schema.json b/schema/catalog-entry.schema.json new file mode 100644 index 0000000..d41e88f --- /dev/null +++ b/schema/catalog-entry.schema.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://drafts.opds.io/schema/catalog-entry.schema.json", + "title": "OPDS Catalog Entry", + "type": "object", + "properties": { + "metadata": { + "$ref": "https://readium.org/webpub-manifest/schema/metadata.schema.json" + }, + "links": { + "type": "array", + "items": { + "$ref": "https://readium.org/webpub-manifest/schema/link.schema.json" + }, + "contains": { + "description": "A catalog entry must contain at least one catalog link.", + "type": "object", + "properties": { + "rel": { + "anyOf": [ + { + "type": "string", + "enum": [ + "http://opds-spec.org/catalog" + ] + }, + { + "type": "array", + "contains": { + "type": "string", + "enum": [ + "http://opds-spec.org/catalog" + ] + } + } + ] + } + } + } + }, + "image": { + "type": "object", + "title": "Image meant to be displayed to the user when browsing catalogs", + "allOf": [ + { + "$ref": "https://readium.org/webpub-manifest/schema/link.schema.json" + }, + { + "description": "The image resource must use one of the following formats: image/jpeg, image/png or image/gif.", + "properties": { + "type": { + "enum": [ + "image/jpeg", + "image/png", + "image/gif" + ] + } + } + } + ] + } + }, + "required": [ + "metadata", + "links" + ] +} diff --git a/schema/feed.schema.json b/schema/feed.schema.json index c0dcbfb..d5fccf1 100644 --- a/schema/feed.schema.json +++ b/schema/feed.schema.json @@ -16,6 +16,7 @@ }, "uniqueItems": true, "contains": { + "type": "object", "properties": { "rel": { "anyOf": [ @@ -37,6 +38,14 @@ ] } }, + "catalogs": { + "description": "A list of catalog-entry objects, to reference other OPDS feeds", + "type": "array", + "items": { + "$ref": "catalog-entry.schema.json" + }, + "uniqueItems": true + }, "publications": { "description": "A list of publications that can be acquired", "type": "array", @@ -56,6 +65,7 @@ { "description": "Each Link Object in a navigation collection must contain a title", "items": { + "type": "object", "required": [ "title" ] @@ -142,6 +152,11 @@ "required": [ "groups" ] + }, + { + "required": [ + "catalogs" + ] } ] } diff --git a/schema/publication.schema.json b/schema/publication.schema.json index 35aa57b..3cd59ae 100644 --- a/schema/publication.schema.json +++ b/schema/publication.schema.json @@ -14,6 +14,7 @@ }, "contains": { "description": "A publication must contain at least one acquisition link.", + "type": "object", "properties": { "rel": { "anyOf": [ @@ -60,6 +61,7 @@ { "description": "At least one image resource must use one of the following formats: image/jpeg, image/png or image/gif.", "contains": { + "type": "object", "properties": { "type": { "enum": [