coder / coder/preview

Using `bool` parameter values not intuitive

Open
#94 2 comments 1 reaction 0 assignees View on GitHub
documentation
Dominant language
Go
Stars
9
Forks
5
Avg merge
3d 20h
Merged PRs (30d)
2

Description

This does not behave as expected because the value is the string literal`"true"`, not the boolean value `true`. This should be made more intuitive, or throw a warning?

```hcl
data "coder_parameter" "ai" {
name = "ai"
display_name = "Use AI?"
description = "Do you want to use AI for this workspace?"
type = "bool"
form_type = "checkbox"
default = false
order = 0
}

data "coder_parameter" "ai_prompt" {
count = data.coder_parameter.ai.value == true ? 1 : 0
name = "prompt"
display_name = "Prompt"
description = ""
type = "string"
form_type = "textarea"
default = ""
styling = jsonencode({
placeholder = "hello world"
})
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.