fix(serializer): report all missing constructor arguments in instantiateObject#7805
Merged
soyuka merged 3 commits intoapi-platform:4.2from Feb 27, 2026
Merged
fix(serializer): report all missing constructor arguments in instantiateObject#7805soyuka merged 3 commits intoapi-platform:4.2from
soyuka merged 3 commits intoapi-platform:4.2from
Conversation
Member
soyuka
commented
Feb 27, 2026
| Q | A |
|---|---|
| Branch? | 4.2 |
| Tickets | Fixes #7794 and #7785 |
| License | MIT |
| Doc PR | ∅ |
…ateObject | Q | A | ------------- | --- | Branch? | 4.2 | Tickets | Fixes api-platform#7785 | License | MIT | Doc PR | ∅ * Add missing `continue` after collecting a missing constructor argument name, matching Symfony's AbstractNormalizer::instantiateObject() behavior. * Without it, the first missing arg initializes `not_normalizable_value_exceptions` in context, causing subsequent missing args to skip the collection — only the first missing field was reported in MissingConstructorArgumentsException. * Also set `api_platform_input` context flag when re-entering the serializer for input DTO denormalization, so downstream normalizers can detect re-entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9e8cc6c to
9d02040
Compare
… DTOs | Q | A | ------------- | --- | Branch? | 4.2 | Tickets | Fixes api-platform#7794 | License | MIT | Doc PR | ∅ * When re-entering the serializer for input DTO denormalization, the data has already been unwrapped from the JSON:API `data.attributes` structure. * Without this guard, JsonApi\ItemNormalizer::denormalize() runs a second time on flat data, reads `$data['data']['attributes']` → null, and nulls every DTO property. * Skip JSON:API extraction when `api_platform_input` context flag is set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.