diff --git a/pkg/model/model.go b/pkg/model/model.go index 8ece720..9c969ab 100644 --- a/pkg/model/model.go +++ b/pkg/model/model.go @@ -129,6 +129,13 @@ func (v Variable) Validate() []error { } } + // Multiline is only applicable to text types + if v.Multiline { + if v.Type != "text" { + errors = append(errors, newValidationError(v, "multiline is only applicable to text types")) + } + } + // Options are only applicable to select and multiselect types if len(v.Options) > 0 { if v.Type != "select" && v.Type != "multiselect" { diff --git a/testdata/must-fail/number/multiline-number.yml b/testdata/must-fail/number/multiline-number.yml new file mode 100644 index 0000000..506abd9 --- /dev/null +++ b/testdata/must-fail/number/multiline-number.yml @@ -0,0 +1,6 @@ +# yaml-language-server: $schema=https://gttp.dev/schema +variables: + - name: Number + type: number + multiline: true +template: "{{ .Number }}"