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

[FrameworkBundle] Register the ArrayDenormalizer#20480

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

Closed
dunglas wants to merge2 commits intosymfony:3.1fromdunglas:array_denormalizer

Conversation

@dunglas
Copy link
Member

@dunglasdunglas commentedNov 10, 2016
edited
Loading

QA
Branch?3.1
Bug fix?yes
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Registers theArrayDenormalizer class in FrameworkBundle.

Why it's a bug fix?

Because since 3.1, most normalizers are able to deserialize complex types (e.g.: an object embedded in an object). They use theClass\Name[] notation to handle collections.

However, this only works when theArrayDenormalizer has been registered (it is responsible of handling the[] notation).
We do it manually in unit tests, butArrayDenormalizer has never been integrated in FrameworkBundle.

See the test case for further details.

Simperfit, ogizanagi, and SoboLAN reacted with thumbs up emoji
@jvasseur
Copy link
Contributor

Not sure if this should be treated as a bugfix, people could use some specific array denormalizers, adding the generic one could make their application use it instead of their specific denormalizers leading to bugs.

@dunglas
Copy link
MemberAuthor

dunglas commentedNov 10, 2016
edited
Loading

This is very unlikely because:

  • framework's array denormalizer has a low priority
  • the suffix[] is not commonly used in denormalizers

However the bug is real and annoying. Anytime you try to deserialize a document containing an embedded collection, Symfony fails with a an error hard to understand for newcomers (The property "foo" must be of type "Foo\Bar[]", "array" instead).

ogizanagi and ymarillet reacted with thumbs up emoji

@xabbuh
Copy link
Member

👍 I always registered this one on my own in my applications, but having this done for me in core is much nicer.

Status: Reviewed

@fabpot
Copy link
Member

Thank you@dunglas.

fabpot added a commit that referenced this pull requestNov 11, 2016
This PR was squashed before being merged into the 3.1 branch (closes#20480).Discussion----------[FrameworkBundle] Register the ArrayDenormalizer| Q             | A| ------------- | ---| Branch?       | 3.1| Bug fix?      | yes| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aRegisters the `ArrayDenormalizer` class in FrameworkBundle.**Why it's a bug fix?**Because since 3.1, most normalizers are able to deserialize complex types (e.g.: an object embedded in an object). They use the `Class\Name[]` notation to handle collections.However, this only works when the `ArrayDenormalizer` has been registered (it is responsible of handling the `[]` notation).We do it manually in unit tests, but `ArrayDenormalizer` has never been integrated in FrameworkBundle.See the test case for further details.Commits-------2eedafc [FrameworkBundle] Register the ArrayDenormalizer
@fabpotfabpot closed thisNov 11, 2016
@dunglasdunglas deleted the array_denormalizer branchNovember 11, 2016 15:51
This was referencedNov 17, 2016
nicolas-grekas added a commit that referenced this pull requestFeb 1, 2017
… case (xabbuh)This PR was merged into the 2.8 branch.Discussion----------[FrameworkBundle] add missing functional Serializer test case| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |This is needed to make the test introduced in#21370. It basically backports the functional test config as introduced by@dunglas in#20480.Commits-------24243ac add missing functional Serializer test case
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@dunglas@jvasseur@xabbuh@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp