-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Notice when trying to de-serizlize incorrect value type #880
Comments
Not sure about it... your underlying data looks to be an array, but you declared it as a string.... so a php error is what to expect. |
@goetas I think it shoul be catched and converted to exception to let developer know of incorrect configuration or incorrect value. For example, if incorrect value received via POST request, exception definately should be thrown, not just notice. |
In our project we convert notices to exceptions because they often hide code smells in PHP and we thus want execution to stop. With this behaviour, we have no way to gracefully handle invalid POST data in our API. Would you be willing to accept a pull request here? |
Generally speaking, yes! |
I think yes, it's what needed! |
It happens when trying to de-serialize a model, one of the property type is defined as a string in configuration, but actual value is an array. Maybe in this case any exceptions have to be catched and throwed some JMS\Serializer\Exception\Exception?
The text was updated successfully, but these errors were encountered: