File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -1400,6 +1400,16 @@ func (m schemaMap) validate(
14001400 ok = raw != nil
14011401 }
14021402
1403+ err := validateExactlyOneAttribute (k , schema , c )
1404+ if err != nil {
1405+ return nil , []error {err }
1406+ }
1407+
1408+ err = validateAtLeastOneAttribute (k , schema , c )
1409+ if err != nil {
1410+ return nil , []error {err }
1411+ }
1412+
14031413 if ! ok {
14041414 if schema .Required {
14051415 return nil , []error {fmt .Errorf (
@@ -1414,17 +1424,7 @@ func (m schemaMap) validate(
14141424 "%q: this field cannot be set" , k )}
14151425 }
14161426
1417- err := validateRequiredWithAttribute (k , schema , c )
1418- if err != nil {
1419- return nil , []error {err }
1420- }
1421-
1422- err = validateExactlyOneAttribute (k , schema , c )
1423- if err != nil {
1424- return nil , []error {err }
1425- }
1426-
1427- err = validateAtLeastOneAttribute (k , schema , c )
1427+ err = validateRequiredWithAttribute (k , schema , c )
14281428 if err != nil {
14291429 return nil , []error {err }
14301430 }
Original file line number Diff line number Diff line change @@ -6537,7 +6537,7 @@ func TestValidateAtLeastOneOfAttributes(t *testing.T) {
65376537 },
65386538
65396539 Config : map [string ]interface {}{},
6540- Err : false ,
6540+ Err : true ,
65416541 },
65426542
65436543 "Only Unknown Variable Value" : {
You can’t perform that action at this time.
0 commit comments