Skip to content

Commit 83de35e

Browse files
authored
fix: Count unknown value as present during attribute validation (#58)
1 parent 035d3dc commit 83de35e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/validators/AtLeastOneChild.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (validator atLeastOneChild) ValidateObject(ctx context.Context, req validat
2121
defined := make(map[string]bool)
2222
count := 0
2323
for key, attr := range req.ConfigValue.Attributes() {
24-
if attr.IsUnknown() || attr.IsNull() {
24+
if attr.IsNull() {
2525
continue
2626
}
2727
defined[key] = true

internal/validators/ExactlyOneChild.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (validator exactlyOneChild) ValidateObject(ctx context.Context, req validat
2121
defined := make(map[string]bool)
2222
count := 0
2323
for key, attr := range req.ConfigValue.Attributes() {
24-
if attr.IsUnknown() || attr.IsNull() {
24+
if attr.IsNull() {
2525
continue
2626
}
2727
defined[key] = true

0 commit comments

Comments
 (0)