diff --git a/composer.json b/composer.json index f63acff..81774b5 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,13 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "SapientPro", + "email": "info@sapient.pro", + "homepage": "https://sapient.pro/" + } + ], "require": { "php": "^8.1", "ext-mbstring": "*", diff --git a/src/Client/Serializer.php b/src/Client/Serializer.php index 2d92af8..173fca4 100644 --- a/src/Client/Serializer.php +++ b/src/Client/Serializer.php @@ -7,6 +7,7 @@ use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; use Symfony\Component\PropertyInfo\PropertyInfoExtractor; use Symfony\Component\Serializer\Encoder\JsonEncoder; +use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; use Symfony\Component\Serializer\Normalizer\BackedEnumNormalizer; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; @@ -31,12 +32,14 @@ public function __construct() public function deserialize(string $json, string $class): ?EbayModelInterface { - return $this->serializer->deserialize($json, $class, 'json'); + return $this->serializer->deserialize($json, $class, JsonEncoder::FORMAT); } public function serialize(EbayModelInterface $class): string { - return $this->serializer->serialize($class, JsonEncoder::FORMAT); + return $this->serializer->serialize($class, JsonEncoder::FORMAT, [ + AbstractObjectNormalizer::SKIP_NULL_VALUES => true + ]); } public function denormalize(array $data, string $type): ?EbayModelInterface