SpineEventEngine / validation

Apache License 2.0
3 stars 0 forks source link

Improve diagnostics in validation error messages #155

Open alexander-yevsyukov opened 4 days ago

alexander-yevsyukov commented 4 days ago

We need to review the error messages that are set as default by Policy classes in the validation module. An error message in its default syntax should be more helpful and tell not only about the fact and nature of the error, but give:

  1. A field name or a combination of fields that are in error. Message-wide validation options like required_field may involve mo re than one field.
  2. A value of a field or a combination of values that produce an error. Now some policies, like PatternPolicy simply say "String should match regex.". Which string? I what field? Which regex? We need to be more helpful in cases like this.