Always use the SerializerExtractor (from the PropertyInfo component) (#1665)

* Always use the SerializerExtractor (from the PropertyInfo component)

* typo
This commit is contained in:
Guilhem Niot 2020-06-22 16:37:32 +02:00 committed by GitHub
parent 1f4dfb0b2b
commit 8e0713be53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);