encoding/json: Only allow string option for valid types
The "string" option only applies for strings, floats, integers, and booleans as per the documentation. So when decoding ignore the "string" option if the value is not of one of the types mentioned. This matches the Marshal step which also ignores the "string" option for invalid types. Fixes #9812 Change-Id: I0fb2b43d0668bc0e2985886d989abbf2252070e2 Reviewed-on: https://go-review.googlesource.com/10183Reviewed-by: Russ Cox <rsc@golang.org>
Showing
Please
register
or
sign in
to comment