You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System (please complete the following information):
OS: Windows [e.g. linux, macOS]
GO Version: 1.21.1 [e.g. 1.13]
Pkg Version: 1.5.1 [e.g. 1.1.1]
Describe the bug
When validating a struct with a boolean pointer field, an erroneous validation error is returned stating that the value must be a bool even when a boolean value is provided. This occurs specifically when the two_factor_enabled field in the Request struct is assigned a false boolean value.
When running this code, the following erroneous validation error is returned:
{
"two_factor_enabled": {
"bool": "two_factor_enabled value must be a bool"
}
}
Expected behavior
The expected behavior is that the code should pass validation since a boolean value (false) is assigned to the two_factor_enabled field in the Request struct. No validation errors should be returned as the provided value satisfies the bool validation rule.
Screenshots
Not applicable.
Additional context
This unexpected validation error could potentially lead to issues when validating structs with boolean pointer fields. The validation should consider the assigned boolean value and not return an error when a valid boolean (either true or false) is provided. This seems to be an issue with the underlying validation logic for boolean fields.
The text was updated successfully, but these errors were encountered:
System (please complete the following information):
Windows
[e.g. linux, macOS]1.21.1
[e.g.1.13
]1.5.1
[e.g.1.1.1
]Describe the bug
When validating a struct with a boolean pointer field, an erroneous validation error is returned stating that the value must be a bool even when a boolean value is provided. This occurs specifically when the
two_factor_enabled
field in theRequest
struct is assigned afalse
boolean value.To Reproduce
Here's the Go code to reproduce the issue:
When running this code, the following erroneous validation error is returned:
Expected behavior
The expected behavior is that the code should pass validation since a boolean value (
false
) is assigned to thetwo_factor_enabled
field in theRequest
struct. No validation errors should be returned as the provided value satisfies thebool
validation rule.Screenshots
Not applicable.
Additional context
This unexpected validation error could potentially lead to issues when validating structs with boolean pointer fields. The validation should consider the assigned boolean value and not return an error when a valid boolean (either
true
orfalse
) is provided. This seems to be an issue with the underlying validation logic for boolean fields.The text was updated successfully, but these errors were encountered: