v0.13.0
- big refactoring with breaking changes
- validation codes replaced by static errors
validation.Error
added with constructorvalidation.NewError()
Violation.Code() string
replaced byViolation.Unwrap() error
method- package
code
removed - all
Violation
implementations can now be tested by standarderrors.Is()
function for containing static errors
- most of constraint method names now are suffixed with
With
it.IsEqualToString
,it.IsNotEqualToString
,it.IsEqualToNumber
,it.IsNotEqualToNumber
removedvalidation.ViolationList.Each()
renamed tovalidation.ViolationList.ForEach()
validation.ViolationList.Has()
replaced byvalidation.ViolationList.Is()
- signatures for all constraints updated from
Validate<Type>(value, scope)
toValidate<Type>(ctx, validator, value)
validation.Scope
removed (all exported methods moved tovalidation.Validator
)validation.NewTypedArgument()
renamed tovalidation.This()
validation.CustomStringConstraint
renamed tovalidation.StringFuncConstraint
validation.NewCustomStringConstraint()
renamed tovalidation.OfStringBy()
validation.Language
argument removedvalidation.Option
and all implementations removed- argument
With
withOption
method replaced byAt
method with property path validation.PropertyNameElement
renamed tovalidation.PropertyName
validation.ArrayIndexElement
renamed tovalidation.ArrayIndex
it.NotBlankConstraint.AllowNil()
renamed toit.NotBlankConstraint.WithAllowedNil()
it.ChoiceConstraint
blank value behaviour updated (additional methodWithAllowedBlank()
added)- all previous deprecations removed
See all updates in pull request #74