Skip to content

Commit

Permalink
working OPDS JSON Schema (tested with NodeJS r2-streamer-js), see rea…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Aug 29, 2018
1 parent 144eecf commit 4d82fb9
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 49 deletions.
6 changes: 4 additions & 2 deletions schema/acquisition-object.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
}
}
},
"required": ["type"]
}
"required": [
"type"
]
}
18 changes: 14 additions & 4 deletions schema/feed-metadata.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,18 @@
"format": "uri"
},
"title": {
"type": ["string", "array", "object"]
"type": [
"string",
"array",
"object"
]
},
"subtitle": {
"type": ["string", "array", "object"]
"type": [
"string",
"array",
"object"
]
},
"modified": {
"type": "string",
Expand All @@ -38,5 +46,7 @@
"minimum": 0
}
},
"required": ["title"]
}
"required": [
"title"
]
}
39 changes: 29 additions & 10 deletions schema/feed.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@
"description": "Feed-level links such as search or pagination",
"type": "array",
"items": {
"$ref": "link.schema.json",
"$ref": "link.schema.json"
},
"contains": {
"properties": {
"rel": {
"anyOf": [
{ "type": "string", "const": "self" },
{ "type": "array", "contains": { "const": "self" } }
{
"type": "string",
"const": "self"
},
{
"type": "array",
"contains": {
"const": "self"
}
}
]
}
}
Expand All @@ -42,7 +50,9 @@
{
"description": "Each Link Object in a navigation collection must contain a title",
"items": {
"required": ["title"]
"required": [
"title"
]
}
}
]
Expand Down Expand Up @@ -96,19 +106,28 @@
}
}
},
"required": ["metadata", "links"],
"required": [
"metadata",
"links"
],
"additionalProperties": {
"$ref": "http://readium.org/webpub-manifest/schema/subcollection.schema.json"
"$ref": "https://readium.org/webpub-manifest/schema/subcollection.schema.json"
},
"anyOf": [
{
"required": ["publications"]
"required": [
"publications"
]
},
{
"required": ["navigation"]
"required": [
"navigation"
]
},
{
"required": ["groups"]
"required": [
"groups"
]
}
]
}
}
17 changes: 12 additions & 5 deletions schema/link.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
},
"rel": {
"description": "Relation between the linked resource and its containing collection",
"type": ["string", "array"],
"type": [
"string",
"array"
],
"items": {
"title": "string"
}
Expand Down Expand Up @@ -47,11 +50,16 @@
"type": "boolean"
}
},
"required": ["href"],
"required": [
"href"
],
"if": {
"properties": {
"templated": {
"enum": [false, null]
"enum": [
false,
null
]
}
}
},
Expand All @@ -68,6 +76,5 @@
"format": "uri-template"
}
}
}}
}
}
}
Loading

0 comments on commit 4d82fb9

Please sign in to comment.