validator
validator copied to clipboard
Map validation failing with ISO Codes
- [x ] I have looked at the documentation here first?
- [ x] I have looked at the examples provided that may showcase my question here?
Package version eg. v10: v10.23.0
Question:
How can I validate the following map[string]string? It's failing me always with the ISO code but everything is correct.
Code sample, to showcase or reproduce:
Translations map[string]string `validate:"min=1,dive,keys,iso3166_1_alpha2,endkeys,required"`
Could you provide a test case in which your data does not pass the iso3166_1_alpha2 validation?
Similar to https://github.com/go-playground/validator/blob/6c3307e6c64040ebc0efffe9366927c68146ffba/validator_test.go#L12612-L12614