From 078d0c033c4b76549143f199dfdda3944f6c6ae8 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 16 Nov 2024 17:42:27 +0100 Subject: [PATCH] doc(oneof): mention 'enum' (#1326) ## 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 --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index 90a8ade65..83d33824e 100644 --- a/doc.go +++ b/doc.go @@ -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'