[Serializer] Fix denormalizing custom class in UidNormalizer #44600
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.
Considering we support denormalizing any subclass of
AbstractUid::class
we should not denormalize any$type !== Ulid::class
toUuid::class
because this is wrong. We need to call$type::fromString
(seeTestCustomUid
).But
fromString()
is an abstract method, so it cannot be called directly on abstract classes, I guess we should have not supported them from the start. However, since they work right now (since all abstract classes fall back to theUuid:class
behavior) we cannot break it. So I propose to deprecate supporting abstract classes in 6.1 and remove it in 7.0.The text was updated successfully, but these errors were encountered: