You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-add getter for MetadataFactory in Serialzier to make it possible again to override metadata types like this:
/** @var \JMS\Serializer\Metadata\PropertyMetadata $itemsMetadata */
$itemsMetadata = $this->serializer->getMetadataFactory()->getMetadataForClass(Content::class)->propertyMetadata['items'];
$itemsMetadata->setType($type);
Expected Result
This code worked in version 1.x and breaks ins version (2.x) 3.x
Actual Result
Found no other way to achieve the desired type override.
The text was updated successfully, but these errors were encountered:
Hi @tgaertner!
This usage seems to be a bit hacky to override the property types on the Factory level and might impact performance & Could you provide more context what is a use case for you? May I will be better to help you with some better solution :)
Re-add getter for MetadataFactory in Serialzier to make it possible again to override metadata types like this:
/** @var \JMS\Serializer\Metadata\PropertyMetadata $itemsMetadata */
$itemsMetadata = $this->serializer->getMetadataFactory()->getMetadataForClass(Content::class)->propertyMetadata['items'];
$itemsMetadata->setType($type);
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: