The issue is that when reading such a declaration, it’s not clear that the Validate attribute does not work with Compare, because it operates only on raw input data before those values are actually assigned to the class properties.
#[Body('email')]
#[Trim]
#[Validate(
new Required(),
new Email(),
)]
In this example, it’s not obvious from the Validate attribute itself that the validation is performed only on the raw data.
I suggest renaming the #[Validate] attribute to #[ValidateRaw].
The issue is that when reading such a declaration, it’s not clear that the Validate attribute does not work with Compare, because it operates only on raw input data before those values are actually assigned to the class properties.
In this example, it’s not obvious from the Validate attribute itself that the validation is performed only on the raw data.
I suggest renaming the #[Validate] attribute to #[ValidateRaw].