encoding/json: include field name in error for decoding unquoted number into",string" tag #67774
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
all version affected
Output of
go env
in your module/workspace:What did you do?
try unmarshalling json quoted with int, with and without ",string", all combination only works
this is quite annoying if there's bunch of fields in the struct (eg. 24+) and the error super unclear
json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64
, which field?What did you see happen?
just
json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64
What did you expect to see?
either clearer error message showing which field like:
json: invalid use of ,string struct tag, trying to unmarshal unquoted value into uint64 field MoneyIDR
or more permissive unmarshalling option that accept both quoted or unquoted number that targets to number field (int64/uint64) so dont have to use js.Number
The text was updated successfully, but these errors were encountered: