json-iterator / go

A high-performance 100% compatible drop-in replacement of "encoding/json"
http://jsoniter.com/migrate-from-go-std.html
MIT License
13.33k stars 1.02k forks source link

Bug: Incompatibility with standard lib (omitempty w/ custom marshaler) #688

Open leizor opened 9 months ago

leizor commented 9 months ago

A field that uses a custom marshaler does not adhere to the omitempty tag the same way that encoding/json does.

Example go playground: https://go.dev/play/p/ccfrr3rvac3