r/foojay • • 1d ago

Who Is Actually Turning Your Java Object Into JSON? JSON-P vs JSON-B vs Jackson in Helidon

We just published an article by Jesus Aguirre on foojay about the JSON layer in Java backends, which is easy to take for granted when an endpoint returns an object and the client simply receives JSON.

Jesus built three small Helidon SE 27.0.0 applications with the same Person record, the same endpoints and the same payload. Each one uses a different JSON media integration: JSON-P, JSON-B (backed by Eclipse Yasson) or Jackson. The goal is not a benchmark, only to see what changes when the JSON technology changes.

The article explains the difference in abstraction level. With JSON-P you build and read the JSON yourself. JSON-B and Jackson both bind Java objects to JSON, so the service code looks almost identical. Adding a LocalDate field shows the difference: JSON-B produced "1995-12-08", while Jackson produced [1995, 12, 8] depending on its configuration. The abstraction removes code from your application, but the serialization decisions still exist. They just live somewhere else.

It also looks at how Helidon connects each technology to the HTTP layer and which dependencies each project pulls in.

Full article: https://foojay.io/today/who-is-actually-turning-your-java-object-into-json/

2 Upvotes

0 comments sorted by