Skip to content

feat: keep the discriminator type of objects whose class is mapped by several types - #369

Merged
joelwurtz merged 2 commits into
mainfrom
feat/discriminator-shared-class
Dec 3, 2026
Merged

joelwurtz merged 2 commits into
mainfrom
feat/discriminator-shared-class

Conversation

@joelwurtz

@joelwurtz joelwurtz commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

When several discriminator types point to the same class, normalizing an object always writes the first type. With the new discriminatorTypeFromObject configuration option (discriminator_type_from_object in the bundle), the discriminator value of the object itself is kept when it is one of the types of its class, as the Symfony 8.2 Serializer does.

The option defaults to false (current behavior). Not setting it is deprecated, it will default to true in 11.0.

Depends on #359.

Base automatically changed from build/symfony-8.2 to main December 3, 2026 15:26
@joelwurtz
joelwurtz deleted the branch build/symfony-8.2 December 3, 2026 15:26
@joelwurtz joelwurtz closed this Dec 3, 2026
@joelwurtz joelwurtz reopened this Dec 3, 2026
@joelwurtz
joelwurtz force-pushed the feat/discriminator-shared-class branch from 04b6cb2 to c23928d Compare December 3, 2026 15:36
@joelwurtz
joelwurtz merged commit 52cf69e into main Dec 3, 2026
6 checks passed
@joelwurtz
joelwurtz deleted the feat/discriminator-shared-class branch December 3, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant