-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nulls.Int quietly disregards bad data #341
Comments
I'm not able to get a
The When I try to use The only thing I can confirm is that |
Bind
behavior* Handle nulls.Int Unmarshal errors properly Fixes #341 * Add tests for nulls.Int UnmarshalJSON
Description
A couple things I noticed when calling
c.Bind
in actions handlers:Steps to Reproduce the Problem
Using buffalo in api mode. A simplified example:
I have a model defined like this:
My create handler has the following lines in it:
Issue 1:
{"my_float_field": "5.5"}
to/create
=> I get a 500 and it seems thatc.Bind
is panicking internally (It is expecting a float and gets a string). I would expectc.Bind
to return an error so that I can handle it gracefully rather than panic / 500./create
=> binding silently discards `my_int_field` value and the struct field values are all null after binding, no error is returnedExpected Behavior
Expect to get error returned in this case rather than a panic and/or silent loss of data
Info
The text was updated successfully, but these errors were encountered: