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
When I submit {"name": "test"}, it works well, but when I send {"name": ["test"]}, I get a Symfony\Component\Validator\Exception\UnexpectedTypeException.
Is there a best practice to protect REST apis from invalid input? For now, I just output this exception as 400 status code.
Thank you!
The text was updated successfully, but these errors were encountered:
Hi there,
I'm building a REST API with SF3.4 and FOSRestBundle and I use forms to filter and validate input data.
Here is an example:
And my form handler:
When I submit
{"name": "test"}
, it works well, but when I send{"name": ["test"]}
, I get a Symfony\Component\Validator\Exception\UnexpectedTypeException.Is there a best practice to protect REST apis from invalid input? For now, I just output this exception as 400 status code.
Thank you!
The text was updated successfully, but these errors were encountered: