Skip to content

Releases: go-playground/validator

Release 9.9.4

03 Feb 18:38
Compare
Choose a tag to compare

What was fixed?

  • Corrected docs for method name change FieldWithValue => VarWithValue
  • Corrected display of translations when field is relfect.Ptr thanks @glb see #340

Release 9.9.3

14 Jan 22:15
48a433b
Compare
Choose a tag to compare

What was fixed?

Update tagCache locking scope to allow for validate.Var and validate.VarCtx to be used from within validations functions. see #335 for details.

Release 9.9.2

06 Jan 03:47
230db62
Compare
Choose a tag to compare

What was fixed/updated?

Updated docs to clarify between validation tag separator or , and or validation tag separator |

Release 9.9.1

13 Dec 16:59
b1f51f3
Compare
Choose a tag to compare

What was fixed?

There was an issue checking for the end of an or validation block and when 2 consecutive or validation blocks existed, it would not return an error or return an incorrect error.

NOTE: This bug only affected validation with consecutive or validation blocks eg.

validate:"tag1|tag2=,tag3|tag4"

block1 = tag1|tag2=
block2 = tag3|tag4

Thanks for reporting the issue @skryja, see #329 for more details

Release 9.9.0

13 Nov 05:00
61caf9d
Compare
Choose a tag to compare

What's new?

Added map key validation support with new keys and endkeys eg.

type Test struct {
  Map map[string]string `validate:"dive,keys,trim,endkeys,trim"`
}

keys must be directly after the dive tag; this was done for efficiency to allow map keys and values to be be handled within the same range.

see docs for more details.

Release 9.8.0

23 Oct 03:07
Compare
Choose a tag to compare

What was added?

Added unique validation for ensuring array|slice contain unique values.

Release 9.7.0

07 Sep 03:48
Compare
Choose a tag to compare

Whats New?

Added new isdefault tag, essentially it's the opposite of required and only intended for specific use cases. See #299 for more details.

What was fixed?

Corrected error in fqdn when value is blank, see #306 for more details.

Release 9.6.0

07 Aug 04:33
Compare
Choose a tag to compare

What's new?

Added hostname and fqdn validations thanks to @senuphtyz and PR #298

Release 9.5.0

30 Jul 03:54
Compare
Choose a tag to compare

What new?

Added contextual validation support via context.Context: thanks to @thaonx @NUXIER and PR #292

  • RegisterValidationCtx(...)
  • RegisterStructValidationCtx(...)
  • StructCtx(...)
  • StructFilteredCtx(...)
  • StructPartialCtx(...)
  • StructExceptCtx(...)
  • VarCtx(...)
  • VarWithValueCtx(...)

NOTE: in v10 release all old methods will be removed and only new Context methods will remain.

Release 8.18.2

30 Jul 05:03
Compare
Choose a tag to compare

What was fixed?

Backported some test fixes to solve false positives