Skip to content

[Serializer] Custom normalizer getSupportedTypes details #20341

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jennevdmeer opened this issue Oct 22, 2024 · 1 comment
Closed

[Serializer] Custom normalizer getSupportedTypes details #20341

jennevdmeer opened this issue Oct 22, 2024 · 1 comment
Labels
hasPR A Pull Request has already been submitted for this issue. Serializer
Milestone

Comments

@jennevdmeer
Copy link
Contributor

I think that the getSupportedTypes section could use a bit more information as to when a normalizer can or can not be cached. I've seen this question a few times in slack, it seems the general concept is not really clear from the docs.

Most confusion is that people think it would cache the normalization result. While in fact it just caches if the normalizer class names should be reused directly from the hashmap, without checking supportsNormalization if data is for said specific type(s).

One thing I personally found missing was does inheritance work when defining getSupportedTypes types. Afaik this is false(?) as it creates a hashmap for lookup, but might be worth mentioning.

@javiereguiluz javiereguiluz added this to the 6.4 milestone Jun 4, 2025
@javiereguiluz javiereguiluz added the hasPR A Pull Request has already been submitted for this issue. label Jun 4, 2025
javiereguiluz added a commit that referenced this issue Jun 10, 2025
…stom serializers (javiereguiluz)

This PR was merged into the 6.4 branch.

Discussion
----------

[Serializer] Update the `getSupportedTypes()` docs of custom serializers

Fixes #20341.

Commits
-------

a22eaed [Serializer] Update the getSupportedTypes() docs of custom serializers
@javiereguiluz
Copy link
Member

Closed by #21042.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Serializer
Projects
None yet
Development

No branches or pull requests

3 participants