Open tdbs opened 4 years ago
Similar issue for me, I'd love to validate both keys and values of a map[string]string
with different rules for keys and values. Achieved so far by building a custom validation rule and validate function. Maybe something similar to the when
/else
construct:
validation.Each(validation.Required).Keys(is.UUID))
for validating all keys are UUIDs, and the values are required.
--
Jens Erat \jens.erat@daimler.com\, Daimler TSS GmbH
Imprint
When using the Each() func to validate a map, it iterates over the values, but not the keys. Keys may be invalid too, so I would like to test both.