Skip to content

Commit 299649a

Browse files
committed
add wordle
1 parent 78c1308 commit 299649a

File tree

4 files changed

+2378
-40
lines changed

4 files changed

+2378
-40
lines changed

extract/parameter.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ func ParameterValidationFromBlock(block *terraform.Block) (types.ParameterValida
243243
Min: nullableInteger(block, "min"),
244244
Max: nullableInteger(block, "max"),
245245
Monotonic: nullableString(block, "monotonic"),
246+
Invalid: nullableBoolean(block, "invalid"),
246247
}
247248

248249
return p, diags
@@ -343,6 +344,20 @@ func optionalBoolean(block *terraform.Block, key string) bool {
343344
return val.True()
344345
}
345346

347+
func nullableBoolean(block *terraform.Block, key string) *bool {
348+
attr := block.GetAttribute(key)
349+
if attr == nil || attr.IsNil() {
350+
return nil
351+
}
352+
val := attr.Value()
353+
if val.Type() != cty.Bool {
354+
return nil
355+
}
356+
357+
b := val.True()
358+
return &b
359+
}
360+
346361
func nullableInteger(block *terraform.Block, key string) *int64 {
347362
attr := block.GetAttribute(key)
348363
if attr == nil || attr.IsNil() {

testdata/connections/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ data "coder_parameter" "rows" {
9696
}
9797
}
9898

99-
validation {
100-
error = "Hey!"
101-
invalid = length(data.coder_parameter.rows[each.value].value) > 4
102-
}
99+
# validation {
100+
# error = "Hey! ${length(data.coder_parameter.rows[each.value].value)}"
101+
# invalid = true
102+
# }
103103
}
104104

105105

0 commit comments

Comments
 (0)