Fix order array sum normalizedData and nestedData #51825
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With the update of Serializer to 6.3.5, some deserialization of array to objects does behave differently (changed order of priority of configuration via attribute
#[SerializedPath]
vs. property name, when there is a key on root level with the same name as the private property.Related to #49700.
How to reproduce
Example to explain changed behavior:
Before 6.3.5, the value of the id was
id-1
, with the change of #49700, the value of the id becomesid-2
.#49700 changes
array_merge
witharray + array
. It seems that the problem stated above is related to the fact that array_merge does overwrite keys differently than array + array:Solution
As
array_merge
does behave slightly differently that array + array, the solution could be to switch array order to:This would result in the same, while keeping the fix (#49700) for the numeric key value