Post #3454287
2026-06-24 00:09 UTC
@john@social.ahlroos.me Hi, I’m not sure if you saw @mehmandarov@mastodon.social’s article posted just a little while before your question:
https://mastodon.social/@mehmandarov/116792525382514461#
He describes Jackson as “strict” and other JSON libraries as “lenient”. Why is Jackson strict? I don’t know the actual reason but I have a plausible guess: an “extra” but unknown property might change the interpretation of one of the known properties.
#Java #Jackson (1/2)
Replies (1)
-
@stuartmarks@mastodon.social 2026-06-24 00:09
With the room example, the "floor" member indicates the floor of the building. But does «"floor": 1» indicate the ground floor (US style) or the first floor above ground level (EU style)? A new version might add «"groundFloor": 0» to indicate which convention is used. A strict implementation would give an error if "groundFloor" isn’t expected. This certainly can be inconvenient but it might be better than silently processing the record incorrectly. (2/2) @john@social.ahlroos.me @mehmandarov@mastodon.social