Skip to content

Commit

Permalink
fix: AttributeLoader instead of AnnotationLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarin committed Dec 16, 2023
1 parent 3fb3ac8 commit 827f0a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ApiSerializer/ApiSerializerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Symfony\Component\Serializer\Mapping\ClassDiscriminatorFromClassMetadata;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
Expand All @@ -27,9 +28,7 @@ public function __invoke(): ApiSerializerInterface

private function getDefaultNormalizers(): array
{
$classMetadataFactory = new ClassMetadataFactory(
new AnnotationLoader(new AnnotationReader())
);
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());

$metadataAwareNameConverter = new MetadataAwareNameConverter($classMetadataFactory);

Expand Down

0 comments on commit 827f0a6

Please sign in to comment.