Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update symfony/serializer required version #2680

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

jockos
Copy link
Contributor

@jockos jockos commented Apr 3, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets /
License MIT

Currently, the required version of the symfony/serializer is ^4.1 but in api-platform/core 2.4 we use an interface that is available only since Serializer v4.2 :
final class ReservedAttributeNameConverter implements AdvancedNameConverterInterface

This creates a nice error like that:

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception                       

  [RuntimeException]                                                                                                                                                       
  An error occurred when executing the "'cache:clear --no-warmup'" command:                                                                                                
                                                                                                                                                                           
                                                                                                                                                                           
  Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to ApiPlatform\Core\JsonApi\Serializer\ConstraintViolationLi  
  stNormalizer::__construct() must implement interface Symfony\Component\Serializer\NameConverter\NameConverterInterface or be null, instance of ApiPlatform\Core\JsonApi  
  \Serializer\ReservedAttributeNameConverter given, called in /var/www/amms-api/var/cache/dev/ContainerV9modiz/appDevDebugProjectContainer.php on line 6054 in /var/www/a  
  mms-api/vendor/api-platform/core/src/JsonApi/Serializer/ConstraintViolationListNormalizer.php:35                                                                         
  Stack trace:                                                                                                                                                             
  #0 /var/www/amms-api/var/cache/dev/ContainerV9modiz/appDevDebugProjectContainer.php(6054): ApiPlatform\Core\JsonApi\Serializer\ConstraintViolationListNormalizer->__con  
  struct(Object(ApiPlatform\Core\Metadata\Property\Factory\CachedPropertyMetadataFactory), Object(ApiPlatform\Core\JsonApi\Serializer\ReservedAttributeNameConverter))     
  #1 /var/www/amms-api/var/cache/dev/ContainerV9modiz/appDevDebugProjectContainer.php(6333): Con in /var/www/amms-api/vendor/api-platform/core/src/JsonApi/Serializer/Con  
  straintViolationListNormalizer.php on line 35

@meyerbaptiste meyerbaptiste merged commit 42e0bdc into api-platform:2.4 Apr 3, 2019
@meyerbaptiste
Copy link
Member

Good catch, thanks @jockos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants