Skip to content

Commit

Permalink
Added JSON Schema requirement for non-empty collections/links
Browse files Browse the repository at this point in the history
This commit also contains minor fixed to the formatting of the spec introduced in #56
  • Loading branch information
HadrienGardeur committed Apr 17, 2024
1 parent 95fc056 commit 6c79087
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions opds-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ OPDS 2.0 feeds are identified using the following media type: `application/opds+

<dl>
<dt><dfn>Blank Value</dfn></dt>
<dd>Value encoded in JSON as a `null`, a zero-length string `""`, a zero-length list `[]`, or an object without user-defined properties `{}`.</dd>
<dd>Value encoded in JSON as a <code>null</code>, a zero-length string <code>""</code>, a zero-length list <code>[]</code>, or an object without user-defined properties <code>{}</code>.</dd>
<dt><dfn>Compact Collection</dfn></dt>
<dd>Collection containing only Link values as defined in the [Readium Web Publication Manifest](https://github.com/readium/webpub-manifest)</dd>
<dd>Collection containing only Link values as defined in the <a href="https://readium.org/webpub-manifest/">Readium Web Publication Manifest</a></dd>
</dl>

### 1.3. Conformance Statements
Expand Down
20 changes: 14 additions & 6 deletions schema/feed.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"uniqueItems": true,
"minItems": 1,
"contains": {
"properties": {
"rel": {
Expand Down Expand Up @@ -43,7 +44,8 @@
"items": {
"$ref": "publication.schema.json"
},
"uniqueItems": true
"uniqueItems": true,
"minItems": 1
},
"navigation": {
"description": "Navigation for the catalog using links",
Expand All @@ -52,6 +54,7 @@
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"uniqueItems": true,
"minItems": 1,
"allOf": [
{
"description": "Each Link Object in a navigation collection must contain a title",
Expand All @@ -77,11 +80,13 @@
"items": {
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"uniqueItems": true
"uniqueItems": true,
"minItems": 1
}
}
},
"uniqueItems": true
"uniqueItems": true,
"minItems": 1
},
"groups": {
"description": "Groups provide a curated experience, grouping publications or navigation links together",
Expand All @@ -97,21 +102,24 @@
"items": {
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"uniqueItems": true
"uniqueItems": true,
"minItems": 1
},
"publications": {
"type": "array",
"items": {
"$ref": "publication.schema.json"
},
"uniqueItems": true
"uniqueItems": true,
"minItems": 1
},
"navigation": {
"type": "array",
"items": {
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"uniqueItems": true
"uniqueItems": true,
"minItems": 1
}
},
"required": [
Expand Down

0 comments on commit 6c79087

Please sign in to comment.