Open
Description
Description
Before I was using JsonSerializableNormalizer, and to alter some of my scalar values I needed some extra ScalarNormalizer (removing line breaks and other stuff)
That worked so far.
But then Ii wanted to add some extra features that depended on the properties that didn't work with JsonSerializable
// what characters are invalid
public const REGEX_NAME = '/[^a-zA-Z\ \-,\.\x{00C0}-\x{017F}]*/mu';
#[Context([ScalarNormalizer::INVALID_REGEXP_KEY => self::REGEX_NAME])]
private ?string $name = null;
But it turns out that didn't work either because AbstractObjectNormalizer doesn't allow for scalar values to be extra normalized like the JsonSerializable would.
Would be great if I could have an extra Flag to allow scalar values to be extra normalized while having access to their Property SerializationContext
Edit:
Right now it can be done using NormalizableInterface, but that defeats the whole purpose of using Property SerializationContext
Example
No response