Skip to content

[FrameworkBundle] Fix deprecation layer for "enable_annotations" in validation and serializer configuration #52287

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

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Oct 25, 2023

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

With Symfony 6.4 (without this patch) and the following configuration

framework:
    serializer:
        enable_annotations: true
>…gregoire/dev/labs/symfony/symfony-6.4(main *) bin/console 

In BaseNode.php line 435:
                                                                                                                                                                                            
  Invalid configuration for path "framework.serializer": The "enable_annotations" and "enable_attributes" options at path "framework.serializer" must not be both set. Only the "enable_at  
  tributes" option must be used.                                                                                                                                                            
                                                                                                                                                                                            

In Configuration.php line 1163:
                                                                                                                                                                   
  The "enable_annotations" and "enable_attributes" options at path "framework.serializer" must not be both set. Only the "enable_attributes" option must be used.                                                                                                                                                                     

With this PR

tests:

framework:
    serializer:
        enable_annotations: true

Compilation is OK
Note : this is the previous configuration for some app


framework:
    serializer:
        enable_annotations: true
        enable_attributes: true # same results with false, or null

Compilation is KO
Error :

Invalid configuration for path "framework.serializer": The "enable_annotations" and "enable_attributes" options at path "framework.serializer" must not be both set. Only the "enable_attributes" option must be used.


framework:
    serializer:
        enable_attributes: true # same results with false, or null

Compilation is OK


framework:
    serializer: ~

Compilation is OK

@carsonbot carsonbot added this to the 6.4 milestone Oct 25, 2023
@lyrixx lyrixx requested review from stof and nicolas-grekas October 25, 2023 08:10
@nicolas-grekas nicolas-grekas changed the title [FrameworkBundle] Fix BC break about enable_annotations in validation and serializer configuration [FrameworkBundle] Fix deprecation layer for "enable_annotations" in validation and serializer configuration Oct 25, 2023
@lyrixx lyrixx force-pushed the enable_annotations branch from c6a5e3b to bd0538d Compare October 30, 2023 17:46
@lyrixx
Copy link
Member Author

lyrixx commented Oct 30, 2023

@stof I pushed a new version. I now use beforeNormalization and I was able to revert the change about defaultNull()

@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

@nicolas-grekas nicolas-grekas merged commit 17dee5b into symfony:6.4 Oct 31, 2023
@lyrixx lyrixx deleted the enable_annotations branch October 31, 2023 08:00
This was referenced Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants