Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Open
Jeroeny wants to merge2 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromJeroeny:mixedarray

Conversation

Jeroeny
Copy link
Contributor

@JeroenyJeroeny commentedOct 12, 2023
edited
Loading

QA
Branch?7.2
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

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

@JeroenyJeroenyforce-pushed themixedarray branch 5 times, most recently from3e542ae tocb066b3CompareOctober 12, 2023 15:19
@nicolas-grekasnicolas-grekas added this to the7.1 milestoneOct 27, 2023
@nicolas-grekas
Copy link
Member

Anyone 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).
/cc@mtarld maybe? Anyone else?

@mtarld
Copy link
Contributor

As#53160 has been merged, thevalidateAndDenormalize method is now usingType of TypeInfo component, which can make this patch easier.
So, this PR has to be rebased and updated accordingly.

@Jeroeny
Copy link
ContributorAuthor

Rebased onto 7.1 and description targeting 7.2.

The newvalidateAndDenormalizeLegacy vs validateAndDenormalize` are a bit complex, so not sure yet how to apply the changes to the method using the new types.

@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

6 participants
@Jeroeny@nicolas-grekas@mtarld@fabpot@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp