Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Configurable Serializer name converter #14987

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
Aug 1, 2015

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jun 15, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR symfony/symfony-docs#5483
  • Add tests

@dunglas
Copy link
Member Author

dunglas commented Jun 18, 2015

ping @symfony/deciders

@@ -970,6 +970,12 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
1, new Reference($config['cache'])
);
}

if (isset($config['name_converter']) && $config['name_converter']) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, the isset part is not needed.

@fabpot
Copy link
Member

fabpot commented Jun 19, 2015

Can you also create the PR for the docs?

@xabbuh
Copy link
Member

xabbuh commented Jun 20, 2015

Don't you have to set the default value of the name_converter option to serializer.name_converter.camel_case_to_snake_case so that it is taken by default? Otherwise, the service were only used in the tests.

@dunglas
Copy link
Member Author

dunglas commented Jun 20, 2015

No. If you do that everything will be converted by default and this is not intended nor a best practice.

The name converter definition is here just for convenience and will be removed during the container compilation when not used.

@dunglas
Copy link
Member Author

dunglas commented Jul 4, 2015

Code updated and doc added (symfony/symfony-docs#5483)

@xabbuh
Copy link
Member

xabbuh commented Jul 7, 2015

No. If you do that everything will be converted by default and this is not intended nor a best practice.

The name converter definition is here just for convenience and will be removed during the container compilation when not used.

Thanks for explaining your intentions.

@xabbuh
Copy link
Member

xabbuh commented Jul 7, 2015

👍

1 similar comment
@fabpot
Copy link
Member

fabpot commented Jul 7, 2015

👍

@fabpot
Copy link
Member

fabpot commented Aug 1, 2015

Thank you @dunglas.

@fabpot fabpot merged commit e500a71 into symfony:2.8 Aug 1, 2015
fabpot added a commit that referenced this pull request Aug 1, 2015
…er (dunglas)

This PR was merged into the 2.8 branch.

Discussion
----------

[FrameworkBundle] Configurable Serializer name converter

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | symfony/symfony-docs#5483

- [x] Add tests

Commits
-------

e500a71 [FrameworkBundle] Configurable Serializer name converter
@fabpot fabpot mentioned this pull request Nov 16, 2015
@dunglas dunglas deleted the framework_name_converter branch December 5, 2015 09:03
wouterj added a commit to symfony/symfony-docs that referenced this pull request Feb 6, 2016
This PR was squashed before being merged into the 2.8 branch (closes #5483).

Discussion
----------

[FrameworkBundle] Name converter of Serializer

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes symfony/symfony#14987
| Applies to    | 2.8
| Fixed tickets | n/a

Commits
-------

7a4d9fc [FrameworkBundle] Name converter of Serializer
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.

3 participants