Closed veqryn closed 6 years ago
Gojay does not work with json tags and does not rely on reflection.
It uses methods on decoder/encoder to marshal/unmarshal properties, I suggest you read documentation first.
If you want to do omit empty you can use the omit empty methods on the Encoder
.
e.g:
func (t *SomeType) MarshalJSONObject(enc *gojay.Encoder) {
enc.StringKeyOmitEmpty("someString", t.someString)
}
@francoispqt shouldn't the code generation tool support this then?
Unfortunately the above struct still has its field marshaled even when it is empty.