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
But I am receiving Roda::RodaPlugins::TypecastParams::Error: invalid value in array parameter foo Yes, it's because I am sending a null value as one object in arr. Which should not be a problem, because I am using any converter.
If I use typecast_params.array(:any, 'arr') everything works good, but in that case arr may not be present in params at all...
The text was updated successfully, but these errors were encountered:
array! doesn't look at the type convertor used (and shouldn't because you can override the default type convertors). It is documented to raise an TypecastParams::Error if the returned value is nil or any value in the returned array is nil, so it is operating as expected, and this isn't considered a bug.
In your case, you should probably use array and manually check the resulting value is not nil.
Lets say we have a very simple
roda 3.37.0
appSo
arr
must be present in params and must be an array of any objects. So this request should pass:But I am receiving
Roda::RodaPlugins::TypecastParams::Error: invalid value in array parameter foo
Yes, it's because I am sending anull
value as one object in arr. Which should not be a problem, because I am usingany
converter.If I use
typecast_params.array(:any, 'arr')
everything works good, but in that casearr
may not be present in params at all...The text was updated successfully, but these errors were encountered: