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] Add support for union collection value types inArrayDenormalizer
#52018
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?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
3e542ae
tocb066b3
CompareAnyone with more background on Serializer would be willing to review this PR? (note that it should target 7.1 for now, maybe 7.2 if we can't make it since we're in feature freeze now). |
As#53160 has been merged, the |
Rebased onto 7.1 and description targeting 7.2. The new |
Uh oh!
There was an error while loading.Please reload this page.
Currently only the following array types combination is supported:
array<MyObject>|array<Another>
. This results in arrays with only 1 type of objects.This PR aims to add support for arrays where values can be either of those, like union types:
array<MyObject|Another>
.I've currently tested is successfully against the following types:
DateTimeInterface[]
array<array<DateTimeInterface|DateInterval|string>>
array<DateTimeInterface>|array<DateInterval>
array<DateTimeInterface|DateInterval>
array<DateTimeInterface|null>
See alsohttps://github.com/Jeroeny/reproduce/blob/mixedarray/src/Test.php