Skip to content

Commit d237058

Browse files
committed
Adding docs and completing all validations before returning (#11)
1 parent 58598f8 commit d237058

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

listvalidator/values_are.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,17 @@ func (v valuesAreValidator) Validate(ctx context.Context, req tfsdk.ValidateAttr
4646

4747
for _, validator := range v.valueValidators {
4848
validator.Validate(ctx, request, resp)
49-
if resp.Diagnostics.HasError() {
50-
return
51-
}
5249
}
5350
}
5451
}
5552

53+
// ValuesAre returns an AttributeValidator which ensures that any configured
54+
// attribute value:
55+
//
56+
// - Is a List.
57+
// - That contains list elements, each of which validate against each value validator.
58+
//
59+
// Null (unconfigured) and unknown (known after apply) values are skipped.
5660
func ValuesAre(valueValidators ...tfsdk.AttributeValidator) tfsdk.AttributeValidator {
5761
return valuesAreValidator{
5862
valueValidators: valueValidators,

0 commit comments

Comments
 (0)