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
jsonapi.UnmarshalPayload seems to cast a float value to integer rather than failing. Keep in mind that the struct it will be unmarshaled into is expecting the value to be an integer rather than a float. Is this expected behaviour?
To illustrate what I mean, here is a working example:
jsonapi.UnmarshalPayload
seems to cast a float value to integer rather than failing. Keep in mind that the struct it will be unmarshaled into is expecting the value to be an integer rather than a float. Is this expected behaviour?To illustrate what I mean, here is a working example:
The output shown is:
ID: 10
I was expecting that
jsonapi.UnmarshalPayload
would instead return an error. Is there a way to enforce that the accepted type must be integer?Many thanks in advance 🙏
The text was updated successfully, but these errors were encountered: