diff --git a/core/serialization.md b/core/serialization.md index 20da77f4f2d..0acfc7077d9 100644 --- a/core/serialization.md +++ b/core/serialization.md @@ -579,11 +579,11 @@ namespace App\Serializer; use ApiPlatform\Api\IriConverterInterface; use App\Entity\Dummy; use App\Entity\RelatedDummy; -use Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait; -class PlainIdentifierDenormalizer implements ContextAwareDenormalizerInterface, DenormalizerAwareInterface +class PlainIdentifierDenormalizer implements DenormalizerInterface, DenormalizerAwareInterface { use DenormalizerAwareTrait; @@ -605,6 +605,15 @@ class PlainIdentifierDenormalizer implements ContextAwareDenormalizerInterface, { return \in_array($format, ['json', 'jsonld'], true) && is_a($type, Dummy::class, true) && !empty($data['relatedDummy']) && !isset($context[__CLASS__]); } + + public function getSupportedTypes(?string $format): array + { + return [ + 'object' => null, + '*' => false, + Dummy::class => true + ]; + } } ```