Skip to content

Commit

Permalink
doc(oneof): mention 'enum' (#1326)
Browse files Browse the repository at this point in the history
## Fixes Or Enhances
Mention 'enum' in the documentation for `oneof`. One of our team member
spent too much time looking for an 'enum-like' validation tag, only to
find out later that `oneof` exists. This PR intends on making the
discovery of this validation tag easier.

**Make sure that you've checked the boxes below before you submit PR:**
- [x] Tests exist or have been written that cover this particular
change.

@go-playground/validator-maintainers
  • Loading branch information
Crocmagnon authored Nov 16, 2024
1 parent 51697fb commit 078d0c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ For strings, ints, and uints, oneof will ensure that the value
is one of the values in the parameter. The parameter should be
a list of values separated by whitespace. Values may be
strings or numbers. To match strings with spaces in them, include
the target string between single quotes.
the target string between single quotes. Kind of like an 'enum'.
Usage: oneof=red green
oneof='red green' 'blue yellow'
Expand Down

0 comments on commit 078d0c0

Please sign in to comment.