Search code examples
jsonjacksongsonstandardsjsr-353

Do Jackson and Gson directly implement the standard JSR-353?


I couldn't find an answer to my question on the net (maybe I did not search well enough, since I am still a novice on this).

Could anyone tell me if Jackson and Gson implement the standard JSR 353: Java™ API for JSON Processing. I would like to write using standard code.


Solution

  • This link has the reply (apparently by the Jackson founder), and it essentially says that Jackson doesn't implement the JSR:

    Reply by Tatu Saloranta on January 26, 2014 at 8:21pm

    I am not a big fan of JSR-353 (I consider it a big fail) and unless something drastic happens, Jackson core will not implement JSR-353. There is no benefit from data-binding to use it; both because implementations do not bring anything to table (none are particularly fast), nor implement all that databind needs (base64 encoding, multi-format support capabilities) -- and worst of all ALL existing (de)serializers would need to be rewritten use new, less capable API. And baseline for Jackson would need to become Java 8. So I see no upside.

    However, the reverse is possible; it is possible to have a JSR-353 implementation based on Jackson streaming package, and this has been done already:

    https://github.com/pgelinas/jackson-javax-json.

    Or, to make Jackson capable of reading/writing JSR-353 JSON object types, a simple datatype module is needed. I wrote one a while back:

    https://github.com/FasterXML/jackson-datatype-jsr353

    So if Java developers end up following "the standard" track, Jackson can play along.

    Google didn't (couldn't?) vote on the JSR, and I couldn't find anything on Gson's roadmap either to suggest that they'd want to comply.