When deserializing json to objects I want an exception thrown if a property exists in the json but not in the class I deserialize to.
In Symfony\Component\Serializer\Normalizer\ObjectNormalizer.php
there is only
if ($allowed && !$ignored) {
try {
$this->propertyAccessor->setValue($object, $attribute, $value);
} catch (NoSuchPropertyException $exception) {
// Properties not found are ignored
}
}
How to override or circumvene that?
答案 0 :(得分:0)
Ok, got it. I copied the class over to my own code and implemented the exception at the mentioned location.
It's not really update safe, but I guess it is all what I can get.
Thanks anybody who thought about the question.