govalidator icon indicating copy to clipboard operation
govalidator copied to clipboard

Validation of a pointer to a variable of type bool now checks the value of the variable, not the pointer

Open wberdnik opened this issue 3 years ago • 1 comments

BC Break Report

Summary

Validation of a pointer to a variable of type bool now checks the value of the variable, not the pointer. Error of compatibility has.

Previous behavior (one month ago)

Q A
Version v0.0.0-20200108200545-475eaeb16496

var v struct { Value *bool json:"value" valid:"required"} json.Unmarshal([]byte({"value":false}), &v)

ok, err := govalidator.ValidateStruct(v) =>

ok err
True nil

Current behavior

Q A
Version v0.0.0-20210307081110-f21760c49a8d

=>

ok err
False error "non zero value required"

How to ensure compatibility?

wberdnik avatar Jan 09 '22 11:01 wberdnik

see the same issue. This seems a regression.

dex80526 avatar Aug 15 '22 23:08 dex80526