Skip to content

Commit 12aec75

Browse files
committed
remove invalid option
1 parent e971837 commit 12aec75

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

provider/parameter.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type Validation struct {
3434
Max int
3535
MaxDisabled bool `mapstructure:"max_disabled"`
3636

37-
Invalid bool
3837
Monotonic string
3938

4039
Regex string
@@ -159,6 +158,8 @@ func parameterDataSource() *schema.Resource {
159158
if err != nil {
160159
return diag.FromErr(err)
161160
}
161+
// Set the form_type back in case the value was changed, eg via a
162+
// default.
162163
rd.Set("form_type", parameter.FormType)
163164

164165
if len(parameter.Option) > 0 {
@@ -364,11 +365,6 @@ func parameterDataSource() *schema.Resource {
364365
Description: "A regex for the input parameter to match against.",
365366
Optional: true,
366367
},
367-
"invalid": {
368-
Type: schema.TypeBool,
369-
Optional: true,
370-
Description: "If invalid is 'true', the error will be shown.",
371-
},
372368
"error": {
373369
Type: schema.TypeString,
374370
Optional: true,
@@ -458,10 +454,6 @@ func valueIsType(typ OptionType, value string) diag.Diagnostics {
458454
}
459455

460456
func (v *Validation) Valid(typ OptionType, value string) error {
461-
if v.Invalid {
462-
return v.errorRendered(value)
463-
}
464-
465457
if typ != OptionTypeNumber {
466458
if !v.MinDisabled {
467459
return fmt.Errorf("a min cannot be specified for a %s type", typ)

provider/parameter_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,8 @@ func TestValueValidatesType(t *testing.T) {
690690
t.Parallel()
691691
for _, tc := range []struct {
692692
Name,
693-
Type,
694-
Value,
693+
Type provider.OptionType
694+
Value string
695695
Regex,
696696
RegexError string
697697
Min,

0 commit comments

Comments
 (0)