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

Appearance settings

Conversation

d-mitrofanov-v
Copy link
Contributor

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix -
License MIT

Fixes getting "unknown" in expectedTypes of NotNormalizableValueException if constructor properties have union types and if this property is absent from json. This also fixes getting error "This value should be of type unknown" when building text for PartialDenormalizationException in RequestPayloadValueResolver. The resulting string will be "This value should be of type int|float".

The only problem that i see is that ReflectionUnionType::getTypes() returns types in its own order which might not be the same as the order in constructor. For example, even if we have float|int in constructor, ReflectionUnionType::getTypes() will return types in int, float order. But it seems that getting types in a different order is still better then getting "unknown"

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas force-pushed the fix-unknown-type-in-denormalization-when-union branch from 0cd2b6e to eb8f941 Compare September 15, 2025 13:37
@nicolas-grekas
Copy link
Member

Thank you @d-mitrofanov-v.

@nicolas-grekas nicolas-grekas merged commit 1a60616 into symfony:6.4 Sep 15, 2025
10 of 11 checks passed
This was referenced Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.