You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating the symfony/serializer package from 6 to 7, the following error is generated:
Declaration of JoliCode\Harvest\Api\Normalizer\JaneObjectNormalizer::denormalize($data, $class, $format = null, array $context = []) must be compatible with Symfony\Component\Serializer\Normalizer\DenormalizerInterface::denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
There is also a similar error for the normalize method. The symfony/serializer is a dependency of jane-php/open-api-runtime, though it is just a dev requirement and doesn't need to be used in production deployments. It will happily use versions ^5.4, ^6.4 or ^7.0 of the serializer, so not everyone will necessarily run into this if whatever project they are using this library in does not end up installing a 7.x version of the serializer. It would all depend on how composer determines which set of packages are needed to make all the dependencies work.
I ran a composer update on Laravel 9 with PHP 8.2 and it upgraded the serializer from 6 to 7. It's easy enough to update the JaneObjectNormalizer to be compatible, but that may impact it's compatibility with older versions. I don't know the best way to handle that, but I will submit a pull request to provide a patch and leave it to people who are smarter than be to figure out how to make it compatible with all possible versions that may be used.
The text was updated successfully, but these errors were encountered:
theteknocat
changed the title
Declaration of JoliCode\Harvest\Api\Normalizer\JaneObjectNormalizer::denormalize($data, $class, $format = null, array $context = []) must be compatible with Symfony\Component\Serializer\Normalizer\DenormalizerInterface::denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
Error in JaneObjectNormalizer after updating symfony/serializer to 7.x
Feb 10, 2024
After updating the symfony/serializer package from 6 to 7, the following error is generated:
Declaration of JoliCode\Harvest\Api\Normalizer\JaneObjectNormalizer::denormalize($data, $class, $format = null, array $context = []) must be compatible with Symfony\Component\Serializer\Normalizer\DenormalizerInterface::denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
There is also a similar error for the normalize method. The symfony/serializer is a dependency of jane-php/open-api-runtime, though it is just a dev requirement and doesn't need to be used in production deployments. It will happily use versions ^5.4, ^6.4 or ^7.0 of the serializer, so not everyone will necessarily run into this if whatever project they are using this library in does not end up installing a 7.x version of the serializer. It would all depend on how composer determines which set of packages are needed to make all the dependencies work.
I ran a composer update on Laravel 9 with PHP 8.2 and it upgraded the serializer from 6 to 7. It's easy enough to update the JaneObjectNormalizer to be compatible, but that may impact it's compatibility with older versions. I don't know the best way to handle that, but I will submit a pull request to provide a patch and leave it to people who are smarter than be to figure out how to make it compatible with all possible versions that may be used.
The text was updated successfully, but these errors were encountered: