Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wberdnik opened this issue Jan 9, 2022 · 1 comment

Comments

@wberdnik
Copy link

wberdnik commented Jan 9, 2022

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?

@dex80526
Copy link

see the same issue. This seems a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants