Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow OPDS Publications in OPDS 2 Feeds #39

Open
llemeurfr opened this issue Feb 24, 2021 · 2 comments
Open

Only allow OPDS Publications in OPDS 2 Feeds #39

llemeurfr opened this issue Feb 24, 2021 · 2 comments
Labels

Comments

@llemeurfr
Copy link

llemeurfr commented Feb 24, 2021

In https://drafts.opds.io/opds-2.0#12-publications it is written that the publications json array can contain either OPDS Publications or Readium Web Publication Manifests (RWPM).

Note: The main difference between both structures is the presence of a readingOrder in the latter.

I can understand that presenting a feed of RWPM can in some circumstances appear useful to avoid making an additional fetch to retrieve resources of a specific web publication. But ...

Doing so is cumbersome for reading apps which must take into account two different cases (RWPM included or RWPM fetched from an acquisition link in an OPDS Publication), which is not KISS compliant. Plus the fact that it is not easily possible to disambiguate between a RWPM and an OPDS Publication (both having almost the same structure).

More, it tightly ties the ODPS 2 spec to the RWPM spec, which is not good. Add the possibility to embed RWPM in OPDS 2 makes it non-interoperable with OPDS 1.

The proposal is therefore to remove from 1.2 Publications the possibility to find RWPMs in the publications structure, and move the requirement to have an images collection to 4.1 OPDS Publication, where it logically belongs.

@danielweck
Copy link
Member

danielweck commented Feb 26, 2021

Note that the OPDS "publication" schema only imports the Readium "metadata" JSON Schema, and defines its own structure otherwise:

"metadata": {
"$ref": "https://readium.org/webpub-manifest/schema/metadata.schema.json"
},

@danielweck
Copy link
Member

Besides the common "metadata" object definition, here are the OPDS vs. RWPM JSON Schemas to compare:

"links": {
"type": "array",
"items": {
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"contains": {
"description": "A publication must contain at least one acquisition link.",
"properties": {
"rel": {
"anyOf": [
{
"type": "string",
"enum": [
"preview",
"http://opds-spec.org/acquisition",
"http://opds-spec.org/acquisition/buy",
"http://opds-spec.org/acquisition/open-access",
"http://opds-spec.org/acquisition/borrow",
"http://opds-spec.org/acquisition/sample",
"http://opds-spec.org/acquisition/subscribe"
]
},
{
"type": "array",
"contains": {
"type": "string",
"enum": [
"preview",
"http://opds-spec.org/acquisition",
"http://opds-spec.org/acquisition/buy",
"http://opds-spec.org/acquisition/open-access",
"http://opds-spec.org/acquisition/borrow",
"http://opds-spec.org/acquisition/sample",
"http://opds-spec.org/acquisition/subscribe"
]
}
}
]
}
}
}
},
"images": {
"description": "Images are meant to be displayed to the user when browsing publications",
"type": "array",
"items": {
"$ref": "https://readium.org/webpub-manifest/schema/link.schema.json"
},
"minItems": 1,
"allOf": [
{
"description": "At least one image resource must use one of the following formats: image/jpeg, image/png or image/gif.",
"contains": {
"properties": {
"type": {
"enum": [
"image/jpeg",
"image/png",
"image/gif"
]
}
}
}
}
]
}
},
"required": [
"metadata",
"links",
"images"
]

https://github.com/readium/webpub-manifest/blob/664355b26d715805a5f54477da375ec00f84093f/schema/publication.schema.json#L17-L105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants