There is an entity with property $language:
private Language $language = Language::ES;
On post request data with language from enum list (e.g. es) all is ok. But if value out of list response error (e.g. 00):
{
"title": "An error occurred",
"detail": "The data must belong to a backed enumeration of type App\\Core\\Language",
"status": 400,
"type": "/errors/400"
}
Choice and custom validator useless because they execute AFTER deserialization where that error appears. So i need proper 422 error response. What and how to fix?
There is an entity with property
$language:On post request data with language from enum list (e.g.
es) all is ok. But if value out of list response error (e.g.00):Choice and custom validator useless because they execute AFTER deserialization where that error appears. So i need proper 422 error response. What and how to fix?