We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
System (please complete the following information):
masOs
1.23.3
1.5.2
Describe the bug
When an struct has json tags and has an slice type in it error path is not complete
To Reproduce
package main import ( "encoding/json" "fmt" "github.com/gookit/validate" "os" ) type ( InputGood struct { Data []DataGood } DataGood struct { Name string `validate:"required"` } InputBad struct { Data []DataBad `json:"data"` } DataBad struct { Name string `json:"name" validate:"required"` } ) func main() { inputGood := InputGood{ Data: []DataGood{ {}, {}, }, } validateData(inputGood) inputBad := InputBad{ Data: []DataBad{ {}, {}, }, } validateData(inputBad) } func validateData(i any) { v := validate.Struct(i) v.StopOnError = false v.Validate() _ = json.NewEncoder(os.Stdout).Encode(v.Errors) fmt.Println() fmt.Println() fmt.Println() }
Expected behavior
Show error path using json tags instead struct attributes' names
Screenshots
This is the result of running above code
Additional context
It's just that 😃 Thank you for your time! 🎆
The text was updated successfully, but these errors were encountered:
inhere
No branches or pull requests
System (please complete the following information):
masOs
1.23.3
1.5.2
Describe the bug
When an struct has json tags and has an slice type in it error path is not complete
To Reproduce
Expected behavior
Show error path using json tags instead struct attributes' names
Screenshots
This is the result of running above code

Additional context
It's just that 😃 Thank you for your time! 🎆
The text was updated successfully, but these errors were encountered: