-
-
Notifications
You must be signed in to change notification settings - Fork 9.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 our terms of service and privacy 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
Conversation
src/Symfony/Component/Serializer/Tests/Context/Encoder/CsvEncoderContextBuilderTest.php
Show resolved
Hide resolved
…n private, we keep as is) This reverts commit fbf5fff.
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 |
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: