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
seankhliao
changed the title
encoding/json: do not raise an error if any field is missing from the defined struct
proposal: encoding/json: require all fields
Feb 6, 2021
Hi @rsc @adg
I've noticed that encoding/json doesn't raise an error if any field is not present in the body payload.
Example:
Ideally, this function should give an error like
missingfield name
.DisallowUnknownFields
just take care of extra fields but not the missing field.Golang version: 1.15.6
Let me know if I've missed anything to fix it?
The text was updated successfully, but these errors were encountered: