From 8e0713be5302da82c76102bf9d5215269cf7a0b3 Mon Sep 17 00:00:00 2001 From: Guilhem Niot Date: Mon, 22 Jun 2020 16:37:32 +0200 Subject: [PATCH] Always use the SerializerExtractor (from the PropertyInfo component) (#1665) * Always use the SerializerExtractor (from the PropertyInfo component) * typo --- ModelDescriber/ObjectModelDescriber.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ModelDescriber/ObjectModelDescriber.php b/ModelDescriber/ObjectModelDescriber.php index db373cc..f361151 100644 --- a/ModelDescriber/ObjectModelDescriber.php +++ b/ModelDescriber/ObjectModelDescriber.php @@ -55,9 +55,9 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar $properties = $schema->getProperties(); $class = $model->getType()->getClassName(); - $context = []; + $context = ['serializer_groups' => null]; // Use the SerializerExtractor with no groups check (sf >= 5.1) if (null !== $model->getGroups()) { - $context = ['serializer_groups' => array_filter($model->getGroups(), 'is_string')]; + $context['serializer_groups'] = array_filter($model->getGroups(), 'is_string'); } $annotationsReader = new AnnotationsReader($this->doctrineReader, $this->modelRegistry);