Skip to content

Fix normalizer priorities for correct JsonSerializable handling #2921

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

Conversation

teohhanhui
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets api-platform/api-platform#1018, #2813
License MIT
Doc PR N/A

Replaces #2732

@teohhanhui teohhanhui force-pushed the fix/json-serializable-item-should-not-turn-into-collection branch from 09c7b14 to b0aa298 Compare July 8, 2019 18:59
@dunglas
Copy link
Member

dunglas commented Jul 9, 2019

Can you target master please? A priority hante may introduce major BC breaks, we should’t do such changes in a patch release.

@teohhanhui teohhanhui force-pushed the fix/json-serializable-item-should-not-turn-into-collection branch from b0aa298 to 3c0c835 Compare July 9, 2019 08:04
@teohhanhui teohhanhui changed the base branch from 2.4 to master July 9, 2019 08:04
@teohhanhui
Copy link
Contributor Author

Re-targeted to master.

@teohhanhui
Copy link
Contributor Author

$ bin/console debug:container --tag=serializer.normalizer

Symfony Container Services Tagged with "serializer.normalizer" Tag
==================================================================

----------------------------------------------------------- ---------- ----------------------------------------------------------------------------------------------------- 
Service ID                                                  priority   Class name                                                                                           
----------------------------------------------------------- ---------- ----------------------------------------------------------------------------------------------------- 
api_platform.graphql.normalizer.item                        -890       ApiPlatform\Core\GraphQl\Serializer\ItemNormalizer                                                   
api_platform.graphql.normalizer.object                      -995       ApiPlatform\Core\GraphQl\Serializer\ObjectNormalizer                                                 
api_platform.hal.normalizer.collection                      -985       ApiPlatform\Core\Hal\Serializer\CollectionNormalizer                                                 
api_platform.hal.normalizer.entrypoint                      -800       ApiPlatform\Core\Hal\Serializer\EntrypointNormalizer                                                 
api_platform.hal.normalizer.item                            -890       ApiPlatform\Core\Hal\Serializer\ItemNormalizer                                                       
api_platform.hal.normalizer.object                          -995       ApiPlatform\Core\Hal\Serializer\ObjectNormalizer                                                     
api_platform.hydra.normalizer.collection_filters            -985       ApiPlatform\Core\Hydra\Serializer\CollectionFiltersNormalizer                                        
api_platform.hydra.normalizer.constraint_violation_list     -780       ApiPlatform\Core\Hydra\Serializer\ConstraintViolationListNormalizer                                  
api_platform.hydra.normalizer.documentation                 -800       ApiPlatform\Core\Hydra\Serializer\DocumentationNormalizer                                            
api_platform.hydra.normalizer.entrypoint                    -800       ApiPlatform\Core\Hydra\Serializer\EntrypointNormalizer                                               
api_platform.hydra.normalizer.error                         -800       ApiPlatform\Core\Hydra\Serializer\ErrorNormalizer                                                    
api_platform.jsonapi.normalizer.collection                  -985       ApiPlatform\Core\JsonApi\Serializer\CollectionNormalizer                                             
api_platform.jsonapi.normalizer.constraint_violation_list   -780       ApiPlatform\Core\JsonApi\Serializer\ConstraintViolationListNormalizer                                
api_platform.jsonapi.normalizer.entrypoint                  -800       ApiPlatform\Core\JsonApi\Serializer\EntrypointNormalizer                                             
api_platform.jsonapi.normalizer.error                       -790       ApiPlatform\Core\JsonApi\Serializer\ErrorNormalizer                                                  
api_platform.jsonapi.normalizer.item                        -890       ApiPlatform\Core\JsonApi\Serializer\ItemNormalizer                                                   
api_platform.jsonapi.normalizer.object                      -995       ApiPlatform\Core\JsonApi\Serializer\ObjectNormalizer                                                 
api_platform.jsonld.normalizer.item                         -890       ApiPlatform\Core\JsonLd\Serializer\ItemNormalizer                                                    
api_platform.jsonld.normalizer.object                       -995       ApiPlatform\Core\JsonLd\Serializer\ObjectNormalizer                                                  
api_platform.problem.normalizer.constraint_violation_list   -780       ApiPlatform\Core\Problem\Serializer\ConstraintViolationListNormalizer                                
api_platform.problem.normalizer.error                       -810       ApiPlatform\Core\Problem\Serializer\ErrorNormalizer                                                  
api_platform.serializer.normalizer.item                     -895       ApiPlatform\Core\Serializer\ItemNormalizer                                                           
api_platform.swagger.normalizer.api_gateway                 -780       ApiPlatform\Core\Swagger\Serializer\ApiGatewayNormalizer                                             
serializer.denormalizer.array                               -990       Symfony\Component\Serializer\Normalizer\ArrayDenormalizer                                            
serializer.normalizer.constraint_violation_list             -915       Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer                            
serializer.normalizer.data_uri                              -920       Symfony\Component\Serializer\Normalizer\DataUriNormalizer                                            
serializer.normalizer.dateinterval                          -915       Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer                                       
serializer.normalizer.datetime                              -910       Symfony\Component\Serializer\Normalizer\DateTimeNormalizer                                           
serializer.normalizer.json_serializable                     -900       Symfony\Component\Serializer\Normalizer\JsonSerializableNormalizer                                   
serializer.normalizer.object                                -1000      Symfony\Component\Serializer\Normalizer\ObjectNormalizer                                             
----------------------------------------------------------- ---------- ----------------------------------------------------------------------------------------------------- 

@dunglas dunglas merged commit 8b92034 into api-platform:master Jul 9, 2019
@dunglas
Copy link
Member

dunglas commented Jul 9, 2019

Thanks @teohhanhui! Good one

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.

2 participants