Replies: 1 comment
-
Define a nested struct, and the rule will definitely work. validator/_examples/struct-map-rules-validation/main.go Lines 61 to 89 in 2cce309 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, is it possible to omitempty nested structs when the rules are defined in a map[string]interface{} like below? It seems like the default is for the struct to always be required. If this is not possible, it seems like an alternative approach would be to define a struct with specific validations that enforce which fields are optional.
Beta Was this translation helpful? Give feedback.
All reactions