Closed komly closed 6 years ago
After this changes default json marshaler won't skip fields with zero values in response body.
ts := &types.Timeslot{ Start: 0, Duration: 2, }
now we will response with:
{"start":0,"duration":2}
instead of
{"duration":2}
It breaks proto convention and current behaviour. Servers can control it via OverrideMarshaler("application/json",MarshalerPbJSON{ ... EmitDefaults: true ...}).
OverrideMarshaler("application/json",MarshalerPbJSON{ ... EmitDefaults: true ...})
After this changes default json marshaler won't skip fields with zero values in response body.
now we will response with:
instead of