The android-webpub
package provides a set of types and functions to parse
and serialize WebPub manifests
and OPDS 2.0 feeds.
- Parses WebPub and derivatives such as OPDS 2.0.
- Integrates dixmont for security against deserialization attacks.
- Uses the best-in-class Jackson JSON parser internally.
- High-coverage automated test suite with hundreds of real-life feed samples.
- Apache 2.0 license.
$ mvn clean verify
The type declarations were derived from the WebPub manifest specification and the OPDS 2.0 specification, along with some extensions to the standards that have not been integrated at the time of writing.
The resulting parser is somewhat permissive, and somewhat strict. We are aiming for maximum compatibility with real-world feeds and manifests as opposed to strict adherence to specifications (many of which are currently in draft status anwyay).
Specifically:
-
If a particular JSON property is marked as
required
by the spec, then the property will be required by this parser unless there is at least one real-world feed or manifest that does not conform to the specification. Therefore, the parser can be somewhat more permissive than the specifications allow in this regard. -
If a particular property is defined in the schema as having a particular type, then we do strictly adhere to the types. If a real-world feed or manifest fails to follow the declared type, then we reject the feed or manifest as invalid. Therefore, the parser is strict in its adherence to the specification in this regard.
Our observation seems to be that, if feed/manifest authors declare a property, they tend to get the types right. However, feed/manifest authors do occasionally make mistakes and leave out required properties. Presumably, leaving out a property is an easier mistake to make, and nobody is doing schema validation.