Date: 2024-10-15 07:32:11
Score: 0.5
Natty:
Use a DiscriminatorMap in the "upper" class
https://symfony.com/doc/current/components/serializer.html#serializing-interfaces-and-abstract-classes
#[DiscriminatorMap(typeProperty: 'type', mapping: [
'arr' => SomeDTO::class,
])]
class ArrDTO
{
// ...
}
Reasons:
- Probably link only (1):
- Low length (1):
- Has code block (-0.5):
- High reputation (-1):
Posted by: Ivan Buttinoni