3 ms·
This. If your main use case is JSON as a serialized representation of the ever same object (plus or minus a few optional fields), encoding/json is by far the f
by endymi0n 12y ago
This.
If your main use case is JSON as a serialized representation of the ever same object (plus or minus a few optional fields), encoding/json is by far the fastest and most typesafe way to go.
(edit: Protip - for the really really fastest way to demarshal JSON, look here https://github.com/pquerna/ffjson https://github.com/pquerna/ffjson for some reflection-free extra speed after your code has settled down)
But if your objects can be heterogenous for whatever reasons (think third-party systems, different languages, legacy stacks...) or you're dealing with different kinds of objects landing on the same controller, jason is the perfect complimentary device to deal with more dynamic structures. I've long sought for something like this, thanks to the OP!