-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
component:validatorgood first issuekind:enhancementNew functionality to an existing featureNew functionality to an existing feature
Description
Non-scalar parameters are currently simply converted to strings via their default #to_s method. This leaves for less than ideal outputs in some cases depending on what the value is. E.g.
constraint = AVD::Constraints::Choice.new(
["one", "two", "three"],
message: "{{ value}} is not one of {{ choices }}."
)
puts AVD.validator.validate "four", constraint
# four:
# {{ value}} is not one of ["one", "two", "three"]. (code: c7398ea5-e787-4ee9-9fca-5f2c130614d6)It might not be a bad idea to have a bit more robust/predictable output for these parameters. Can maybe reference https://github.com/symfony/validator/blob/6.2/ConstraintValidator.php#L76-L145.
Metadata
Metadata
Assignees
Labels
component:validatorgood first issuekind:enhancementNew functionality to an existing featureNew functionality to an existing feature