Skip to content

Releases: muonsoft/validation

v0.9.0

14 Apr 20:20
0922cad
Compare
Choose a tag to compare

Big update to generics with lots of breaking changes

  • arguments and constraints refactored
  • generic package with reflection removed
  • some updates for constraints in it package

See all updates in pull request https://github.com/muonsoft/validation/pull/71/files

v0.8.0

29 Jan 18:45
9a95100
Compare
Choose a tag to compare
  • added conditional validation based on validation groups
  • it.IsNumeric() and it.IsInteger() constraints added
  • barcode validation for EAN-8, EAN-13, UPC-A and UPC-E added
    • added functions EAN8, EAN13, UPCA and UPCE into packages is and validate
    • added constraints it.IsEAN8(), it.IsEAN13(), it.IsUPCA() and it.IsUPCE()
  • bugfix: zero time check by time.IsZero() instead of comparing with empty time.Time

v0.7.0

18 Dec 13:50
957b586
Compare
Choose a tag to compare
  • minor BC break message template consts replaced by map in message package
  • validation.CheckNoViolations() argument added to append violations from error
  • fluent assertion functions in validationtest package (see validationtest.Assert()), older functions now are deprecated:
    • validationtest.AssertIsViolation
    • validationtest.AssertIsViolationList
    • validationtest.AssertOneViolationInList

v0.6.0

08 Dec 17:50
Compare
Choose a tag to compare
  • Violation message translator moved to translations package (closes #62 dynamic translations)
  • validation.Translator struct replaced by interface (this might be minor BC break)
  • validation.SetTranslator option added to override internal translator
  • validator.SetUp() method to recreate singleton translator introduced
  • validator.SetOptions() and validator.Reset() now are deprecated (use validator.SetUp() instead)

v0.5.3

05 Dec 11:39
f2c4e5b
Compare
Choose a tag to compare

Ability to run build-in constraints conditionally by using When() method:

  • validation.Checker
  • validation.SequentialConstraint
  • validation.AtLeastOneOfConstraint
  • validation.CompoundConstraint

v0.5.2

08 Nov 18:54
8165199
Compare
Choose a tag to compare
  • validation.Check() and validation.CheckProperty() arguments added for quick validation based on boolean expressions
  • validationtest.AssertOneViolationInList() function added

v0.5.1

31 Oct 07:02
4607a76
Compare
Choose a tag to compare
  • is.Integer and is.Number functions added to test strings against numerics
  • docs updated with runnable example

v0.5.0

11 Aug 07:42
9065c50
Compare
Choose a tag to compare
  • BC break Signature of validator.Validate() and validator.BuildViolation() changed: now it requires context.Context as the first argument.
  • BC break Signature of Validatable interface metod Validate() changed: now it requires context.Context as the first argument.
  • BC break Method validator.WithContext() and argument validation.Context() were removed.
  • BC break Signature of arguments validation.String(), validation.Bool(), validation.Time() changed alongside with alias methods validator.ValidateString(), validator.ValidateBool(), validator.ValidateTime() - now it accepts non-pointer arguments. Use newly added arguments validation.NilString(), validation.NilBool(), validation.NilTime() as a replacement.

v0.4.1

28 Jul 17:38
08e96c9
Compare
Choose a tag to compare
  • is.StringInList function added
  • scope.AtIndex() and scope.AtProperty() now are exported and can be used outside of the package

v0.4.0

20 Jun 10:25
a82edc5
Compare
Choose a tag to compare
  • it.NotNilConstraint and it.NilConstraint now implements validation.BoolConstraint and supports boolean arguments for validation
  • validation.StringsConstraint interface added for validating slice of strings
  • it.UniqueConstraint added to validate slice of strings for uniqueness
  • muonsoft/language package dependency updated to v0.3