graniticio / granitic

Web/micro-services and IoC framework for Golang developers

Home Page:https://granitic.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unset *types.NilableInt64 cause errors on JSON responses

benhalstead opened this issue · comments

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.

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