-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] enable property info in framework bundle #19434
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
[Serializer] enable property info in framework bundle #19434
Conversation
if ($this->isConfigEnabled($container, $config['property_info'])) { | ||
$this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader); | ||
} | ||
|
||
if ($this->isConfigEnabled($container, $config['serializer'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why moving this block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I check below if the service property_info
exists (have you a better idea?). this assumes that property info is built before serializer.
Good catch! The new config flag isn't necessary because the ObjectNormalizer class already contains a test to determine if it can use the PropertyInfo component or not. This PR must be merged in 3.1 as bug fix. You're right, there are a lot of missing docs for the Symfony Serializer (this feature, the MaxDepth annotation, new normalizers like the data: URI one, new encoders...). I've started working on updating the doc but don't except PRs before the end of August (any help welcome, most PRs already include a documentation draft in their descriptions). |
done :) should i create a new PR for symfony 3.1? |
Thanks. No we are able to merge directly this PR in the right branch. Status: reviewed 👍 |
Thank you @DavidBadura. |
…id Badura) This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #19434). Discussion ---------- [Serializer] enable property info in framework bundle | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I've been wondering why the datetime normalizer won't work in combination with object normalizer in symfony 3.1 by default. I also found nothing in the documentation. Only http://symfony.com/blog/new-in-symfony-3-1-datetime-normalizer but here is not described how to use it with the object normalizer and how to configure the config.yml. After debugging i found out that the object normalizer don't use the new property info component. With my change, you can enabled it with following config: ```yml serializer: enabled: true property_info: ~ ``` Should i add analog to `enable_annotation` an `enable_property_info` option? ```yml serializer: enabled: true enable_property_info: true property_info: ~ ``` Commits ------- c02933d enable property info
I've been wondering why the datetime normalizer won't work in combination with object normalizer in symfony 3.1 by default. I also found nothing in the documentation. Only http://symfony.com/blog/new-in-symfony-3-1-datetime-normalizer but here is not described how to use it with the object normalizer and how to configure the config.yml.
After debugging i found out that the object normalizer don't use the new property info component. With my change, you can enabled it with following config:
Should i add analog to
enable_annotation
anenable_property_info
option?