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 @@ -1345,6 +1345,16 @@ func (m schemaMap) validate(
13451345 ok = raw != nil
13461346 }
13471347
1348+ err := validateExactlyOneAttribute (k , schema , c )
1349+ if err != nil {
1350+ return nil , []error {err }
1351+ }
1352+
1353+ err = validateAtLeastOneAttribute (k , schema , c )
1354+ if err != nil {
1355+ return nil , []error {err }
1356+ }
1357+
13481358 if ! ok {
13491359 if schema .Required {
13501360 return nil , []error {fmt .Errorf (
@@ -1359,17 +1369,7 @@ func (m schemaMap) validate(
13591369 "%q: this field cannot be set" , k )}
13601370 }
13611371
1362- err := validateRequiredWithAttribute (k , schema , c )
1363- if err != nil {
1364- return nil , []error {err }
1365- }
1366-
1367- err = validateExactlyOneAttribute (k , schema , c )
1368- if err != nil {
1369- return nil , []error {err }
1370- }
1371-
1372- err = validateAtLeastOneAttribute (k , schema , c )
1372+ err = validateRequiredWithAttribute (k , schema , c )
13731373 if err != nil {
13741374 return nil , []error {err }
13751375 }
Original file line number Diff line number Diff line change @@ -6359,7 +6359,7 @@ func TestValidateAtLeastOneOfAttributes(t *testing.T) {
63596359 },
63606360
63616361 Config : map [string ]interface {}{},
6362- Err : false ,
6362+ Err : true ,
63636363 },
63646364
63656365 "Only Unknown Variable Value" : {
You can’t perform that action at this time.
0 commit comments