Fix: urgent fix for EntityToJsonTransformer

The throw on error flag imposes us to propose a valid json string for decoding
This commit is contained in:
2023-04-28 23:16:13 +02:00
parent 7e3295c71f
commit 2554da9dd8

View File

@@ -43,6 +43,10 @@ class EntityToJsonTransformer implements DataTransformerInterface
public function reverseTransform($value)
{
if ("" === $value) {
return null;
}
$denormalized = json_decode($value, true, 512, JSON_THROW_ON_ERROR);
if ($this->multiple) {
@@ -56,10 +60,6 @@ class EntityToJsonTransformer implements DataTransformerInterface
);
}
if ('' === $value) {
return null;
}
return $this->denormalizeOne($denormalized);
}