Closed ghost closed 6 years ago
I suppose that series links are not yet in our model. if it is the case, the parser should not choke when seeing unknown structures.
@llemeurfr that's not the case, series are part of the current model: https://github.com/readium/r2-shared-swift/blob/master/r2-shared-swift/BelongsTo.swift#L13
If you take a look at the related parser code, you will see that the JSON value called v
is getting casted to [[String: Any]]
.
This is where it fails, only a cast to [String: Any]
could be successful with the provided JSON.
This snippet works with the feed used in this issue:
case "links":
guard let link = v as? [String: Any] else {
throw OPDS2ParserError.invalidCollection
}
c.links.append(try parseLink(linkDict: link))
So, my question is: does the JSON links
key above could have multiple link entry?
This is probably an error on the preprod catalog since links
should always be an array.
I close this one since it was an issue due to the feed itself.
OPDS 2 parser throws
OPDS2ParserError.invalidCollection
with thislinks
key: