Skip to content

Commit

Permalink
🐛 fix: bug fixed on setting error messages for conflicted keys in tags
Browse files Browse the repository at this point in the history
  • Loading branch information
maktoobgar committed Aug 19, 2023
1 parent a26f722 commit 854732e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ CHANGELOG
UNRELEASED
----------

* 🐛 fix: bug fixed on setting error messages for conflicted keys in tags

1.3.3 (2023-07-11)
1.3.4 (2023-07-11)
------------------

* 🐛 fix: children rules can now have no value (they had before for some reason)
Expand Down
6 changes: 5 additions & 1 deletion generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ func (o *generatorS) validator(input interface{}) Validator {
if bindingTags := elementT.Tag.Get("binding"); bindingTags != "" {
splits := strings.Split(bindingTags, ",")
for j := 0; j < len(splits); j++ {
addSpecificMessage(r, splits[j], elementT.Tag.Get(splits[j]))
value := elementT.Tag.Get("_" + splits[j])
if value == "" {
value = elementT.Tag.Get(splits[j])
}
addSpecificMessage(r, splits[j], value)
}
}
rules[elementT.Name] = r
Expand Down

0 comments on commit 854732e

Please sign in to comment.