You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When either using named arguments, or when passing arguments into struct parameters, it would be good for the generated zenrpc API to return an error on unkown fields.
This is detectable today in the standard library by initializing a json.Decoder and calling DisallowUnknownFields on it.
The problem with just using json.Unmarshal as the generated code does today, is that user of the API won't easily discover when they have named parameters wrongly, as there are no clear error messages.
The text was updated successfully, but these errors were encountered:
smyrman
changed the title
Return error on unknown fields.
Return an error on unknown JSON fields
Oct 30, 2019
When either using named arguments, or when passing arguments into struct parameters, it would be good for the generated zenrpc API to return an error on unkown fields.
This is detectable today in the standard library by initializing a
json.Decoder
and callingDisallowUnknownFields
on it.https://golang.org/pkg/encoding/json/#Decoder.DisallowUnknownFields
The problem with just using
json.Unmarshal
as the generated code does today, is that user of the API won't easily discover when they have named parameters wrongly, as there are no clear error messages.The text was updated successfully, but these errors were encountered: