asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6.05k stars 555 forks source link

Struct validation is skipped for fields containing slices of pointers to struct #414

Open boyvinall opened 3 years ago

boyvinall commented 3 years ago

Bug Report

Q A
Version(s) master/v11

Summary

Given the following type, the fields in Address are not validated:

type SlicePtrAddress struct {
    Addresses []*Address
}

This type of struct is common in GRPC.

dex80526 commented 3 years ago

Ran into the exact problem. After spending hours to narrow it down (before see this issue). The fix looks correct. Could we merge the fix in?

sergeyglazyrindev commented 3 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.