graniticio / granitic

Web/micro-services and IoC framework for Golang developers
https://granitic.io/
Apache License 2.0
35 stars 12 forks source link

Unset *types.NilableInt64 cause errors on JSON responses #28

Closed benhalstead closed 1 year ago

benhalstead commented 5 years ago

If a struct used as a ws.Response.Body contains a field of type *types.NilableInt64 and no value has been explicitly set, JSON serialisation fails with:

Problem writing response: json: error calling MarshalJSON for type *types.NilableInt64: unexpected end of JSON input

Expected behaviour is that the field is not included in the response. Check behaviour of other nilable types and XML serialisation.

benhalstead commented 1 year ago

Unable to reproduce on 2.3. Tests in ws.json.marshal_test