From 678f8d753f55234653d96962059954a83df7ea78 Mon Sep 17 00:00:00 2001 From: A Mashmooli Date: Wed, 1 May 2019 09:03:45 +0430 Subject: [PATCH] add required_with_all to doc --- doc.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc.go b/doc.go index e6dbe0c..19d9b66 100644 --- a/doc.go +++ b/doc.go @@ -256,12 +256,26 @@ ensures the value is not nil. Examples: - // require the field if the Field1 is not present: + // require the field if the Field1 is present: Usage: required_with=Field1 - // require the field if the Field1 and Field2 is not present: + // require the field if the Field1 or Field2 is present: Usage: required_with=Field1 Field2 +Required With All + +The field under validation must be present and not empty only if all +of the other specified fields are present. For strings ensures value is +not "". For slices, maps, pointers, interfaces, channels and functions +ensures the value is not nil. + + Usage: required_with_all + +Examples: + + // require the field if the Field1 and Field2 is present: + Usage: required_with_all=Field1 Field2 + Is Default This validates that the value is the default value and is almost the