akrennmair / newsbeuter

Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
http://www.newsbeuter.org/
MIT License
781 stars 100 forks source link

Consider migration to `json` library #279

Open Minoru opened 8 years ago

Minoru commented 8 years ago

json project claims to provide proper integration of JSON with C++. Migration to this library will rid us of tons of C-style cruft we have in API classes.

Should make sure that it's available in major Linux distros, though.

Minoru commented 7 years ago

Should make sure that it's available in major Linux distros, though.

This particular library is header-only.

Minoru commented 7 years ago

Nicolas Seriot demonstrates that parsing JSON isn't as easy as it seems, and a lot of parsers do it wrong. Particularly disturbing is the following:

The "should have failed" tests (in yellow) are more benign. They indicate a JSON "extension" that can be parsed. Everything will work fine, until the parser is replaced with another parser which does not parse the same "extensions"...

We don't seem to have a problem with json-c at the moment, but if we migrate to another library, an extensive testing of all remote APIs will be required in order to check if we didn't accidentally break anything, even if the code migration itself was straightforward.

Minoru commented 7 years ago

Nicolas put his tests on GitHub. There's a PR to add json-c: nst/JSONTestSuite#29

Also an issue with a list of C++ parsers to test: nst/JSONTestSuite#21