Closed
Description
Description
At the moment it is possible to define serializer config through:
- xml
- yaml
- annotations
It would be nice to have an interface/method to implement configuration in PHP classes just like Validators loadValidatorMetadata(ClassMetadataInterface $metadata): void
.
Example
class ClassToSerialize {
protected string $myProperty;
public static function loadSerializerMetadata(ClassMetadataInterface $metadata): void
{
$metadata->addProperty("myProperty", [
"groups" => ["default"]
]);
}
}