Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Serializer] CsvEncoder: allow the nested array parsing to be disabled#49692
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
[Serializer] CsvEncoder: allow the nested array parsing to be disabled#49692
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Tests/Context/Encoder/CsvEncoderContextBuilderTest.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…n private, we keep as is)This reverts commitfbf5fff.
I'm 👍 for the feature, but what about encoding? You should update |
Also, using |
@Deuchnord open to finish this PR? I would really appreciate this new feature! Please rebase on 7.1 branch, thanks |
I'm sorry, I didn't have much time lastly |
Uh oh!
There was an error while loading.Please reload this page.
By default,
CsvEncoder
decoding process explodes the headers automatically based on the.
character to generate nested arrays, the separation character being configurable based on our needs. For instance:Would result in the following PHP array:
This is a very nice feature, but in some cases, we prefer to skip the generation of those nested arrays.
This PR provides a way to disable it by simply setting the already existent
CsvEncoder::KEY_SEPARATOR_KEY
option tofalse
, so the same CSV above now results to: