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

Null JSON values are parsed as "null" strings #190

Closed
mickael-menu opened this issue Jan 4, 2021 · 1 comment · Fixed by readium/r2-shared-kotlin#139
Closed

Null JSON values are parsed as "null" strings #190

mickael-menu opened this issue Jan 4, 2021 · 1 comment · Fixed by readium/r2-shared-kotlin#139
Labels
bug Something isn't working

Comments

@mickael-menu
Copy link
Member

When a RWPM contains a null value, it is interpreted as the "null" string in the parsed model. For example:

{
  "href": "chap.xhtml",
  "type": "application/xhtml+xml",
  "title": null
}
@mickael-menu mickael-menu added the bug Something isn't working label Jan 4, 2021
@mickael-menu
Copy link
Member Author

It's actually a "bug" in Java APIs: https://stackoverflow.com/questions/18226288/json-jsonobject-optstring-returns-string-null

But I think we can tackle this in our custom optNullableString().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant