'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 1:[1]
tl;dr
Use:
Update
The other two Answers are correct, but outdated. As they explain, Jackson does not directly implement any JSR.
However:
- There is a project providing a datatype module to help make Jackson more compatible with JSR 353: jackson-datatype-jsr353.
- JSR 353 is superseded by JSR 374: Java™ API for JSON Processing 1.1.
- The JCP continued work on JSON support, for processing of JSON as well as binding yielding the pair of JSRs: 374 JSON-P & 367 JSON-B.
- JSR 374 defines JSON processing (JSON-P).
- See project page for JSON-P.
- A reference implementation can be found in Glassfish, the reference implementation of Jakarta EE (formerly known as Java EE).
- JSR 367 provides binding capabilities (JSON-B).
- See the project page for JSON-B.
- Yasson is the reference implementation.
- JSR 374 defines JSON processing (JSON-P).
So you may indeed now write in standard code using JSON libraries other than Jackson.
Solution 2:[2]
No, neither implements this API natively, nor has plans (that I know of) to implement it. As far as JCP standards go, this is DOA; it offers very little (dumbed-down streaming API, no data-binding at all), and there is very little incentive for anyone to implement it, except to add compatibility check-box for set of JSRs implemented.
There is a Jackson-based JSR-353 implementation available at https://github.com/pgelinas/jackson-javax-json/ however, if you really think it is good idea to base your code on this API.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | StaxMan |
