Repository navigation
Pass non-array values from ObjectNormalizer to the hydrator - #239
Merged
Merged
Conversation
|
Hello 👋 Here are the most recent benchmark results, compared against StackHydrator
StackHydratorWithCryptography
StackHydratorWithLazy
This comment gets updated every time a new commit comes in. |
DanielBadura
approved these changes
Nov 6, 2026
DavidBadura
force-pushed
the
object-normalizer-class-normalizer
branch
from
November 7, 2026 10:30
706c10b to
722399b
Compare
Member
Author
Extracting an object applies its class normalizer, so the result can be a scalar, but denormalize rejected everything that was not an array. Such a property could be written but never read back. Now the hydrator decides: it uses the class normalizer or throws ArrayDataRequired if there is none.
DavidBadura
force-pushed
the
object-normalizer-class-normalizer
branch
from
November 7, 2026 10:50
722399b to
68fb733
Compare
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.
ObjectNormalizer::normalize()goes throughextract(), which applies the class normalizer of the object, so the result can be a scalar.denormalize()rejected everything that was not an array before callinghydrate(), so a property with an explicit#[ObjectNormalizer]whose class has its own normalizer could be written but never read back.Now non-array values are passed on to the hydrator, which uses the class normalizer or throws
ArrayDataRequiredif there is none. Through the hydrator the thrown exception stays aDenormalizationFailure, only the previous exception changes fromInvalidArgumenttoArrayDataRequired.Found while moving patchlevel/odm to hydrator 2 (patchlevel/odm#29).