Skip to content

Commit

Permalink
Merge pull request #7 from pauci/feature/serializer-preserve-empty-ob…
Browse files Browse the repository at this point in the history
…jects

feat: Configure symfony serializer to preserve empty objects
  • Loading branch information
pauci authored Jan 25, 2022
2 parents 5b92819 + 56036f1 commit abe5ded
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SerializerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use CQRS\Serializer\SymfonySerializer;
use CQRSFactory\Exception\DomainException;
use Psr\Container\ContainerInterface;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
use Symfony\Component\Serializer\SerializerInterface as SymfonySerializerInterface;

/**
Expand Down Expand Up @@ -49,6 +50,9 @@ protected function getDefaultConfig(): array
return [
'class' => SymfonySerializer::class,
'instance' => SymfonySerializerInterface::class,
'context' => [
AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS => true,
],
];
}
}

0 comments on commit abe5ded

Please sign in to comment.