Skip to content

v0.13.0

Compare
Choose a tag to compare
@strider2038 strider2038 released this 10 Jul 17:35
· 47 commits to main since this release
03ceef9
  • big refactoring with breaking changes
  • validation codes replaced by static errors
    • validation.Error added with constructor validation.NewError()
    • Violation.Code() string replaced by Violation.Unwrap() error method
    • package code removed
    • all Violation implementations can now be tested by standard errors.Is() function for containing static errors
  • most of constraint method names now are suffixed with With
  • it.IsEqualToString, it.IsNotEqualToString, it.IsEqualToNumber, it.IsNotEqualToNumber removed
  • validation.ViolationList.Each() renamed to validation.ViolationList.ForEach()
  • validation.ViolationList.Has() replaced by validation.ViolationList.Is()
  • signatures for all constraints updated from Validate<Type>(value, scope) to Validate<Type>(ctx, validator, value)
  • validation.Scope removed (all exported methods moved to validation.Validator)
  • validation.NewTypedArgument() renamed to validation.This()
  • validation.CustomStringConstraint renamed to validation.StringFuncConstraint
  • validation.NewCustomStringConstraint() renamed to validation.OfStringBy()
  • validation.Language argument removed
  • validation.Option and all implementations removed
  • argument With with Option method replaced by At method with property path
  • validation.PropertyNameElement renamed to validation.PropertyName
  • validation.ArrayIndexElement renamed to validation.ArrayIndex
  • it.NotBlankConstraint.AllowNil() renamed to it.NotBlankConstraint.WithAllowedNil()
  • it.ChoiceConstraint blank value behaviour updated (additional method WithAllowedBlank() added)
  • all previous deprecations removed

See all updates in pull request #74