Skip to content

Commit c9b8b39

Browse files
bendbennettIvan De Marinobflad
authored
Adding Any/Or Generic Validator (#43)
* Adding Any validator (#28) * Adding All validator for use with Any validator (#28) * Adding .changelog file (#28) * Rewording test (#28) * Apply suggestions from code review Co-authored-by: Ivan De Marino <[email protected]> * Checking diagnostics for error with each validator (#28) * Updated following code review (#28) * Returning all accumulated warnings when Any() validation passes (#28) * Linting (#28) * Adding AnyWithAllWarningsValidator (#28) * Updating CHANGELOG and formatting (#28) * Refactoring to use diags.Warnings convenience func and updating to use path.Root() to replace tftypes.NewAttributePath().WithAttrrtibuteName() (#28) * Updating docs (#28) * Apply suggestions from code review Co-authored-by: Brian Flad <[email protected]> * Removing unneeded diag file (#28) * Adding tests for type mismatch (#28) * Removing duplicated interface check (#28) Co-authored-by: Ivan De Marino <[email protected]> Co-authored-by: Brian Flad <[email protected]>
1 parent 068f3aa commit c9b8b39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+732
-101
lines changed

.changelog/43.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:feature
2+
Introduced `metavalidator` package with `Any()`, `AnyWithAllWarnings()`, and `All()` validation functions
3+
```

float64validator/at_least.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
87
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
8+
9+
"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
910
)
1011

1112
var _ tfsdk.AttributeValidator = atLeastValidator{}

float64validator/at_least_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
9+
"github.com/hashicorp/terraform-plugin-framework/path"
910
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
11-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1212
)
1313

1414
func TestAtLeastValidator(t *testing.T) {
@@ -55,7 +55,7 @@ func TestAtLeastValidator(t *testing.T) {
5555
name, test := name, test
5656
t.Run(name, func(t *testing.T) {
5757
request := tfsdk.ValidateAttributeRequest{
58-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
58+
AttributePath: path.Root("test"),
5959
AttributeConfig: test.val,
6060
}
6161
response := tfsdk.ValidateAttributeResponse{}

float64validator/at_most_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
9+
"github.com/hashicorp/terraform-plugin-framework/path"
910
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
11-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1212
)
1313

1414
func TestAtMostValidator(t *testing.T) {
@@ -55,7 +55,7 @@ func TestAtMostValidator(t *testing.T) {
5555
name, test := name, test
5656
t.Run(name, func(t *testing.T) {
5757
request := tfsdk.ValidateAttributeRequest{
58-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
58+
AttributePath: path.Root("test"),
5959
AttributeConfig: test.val,
6060
}
6161
response := tfsdk.ValidateAttributeResponse{}

float64validator/between_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/float64validator"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
9+
"github.com/hashicorp/terraform-plugin-framework/path"
910
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
11-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1212
)
1313

1414
func TestBetweenValidator(t *testing.T) {
@@ -73,7 +73,7 @@ func TestBetweenValidator(t *testing.T) {
7373
name, test := name, test
7474
t.Run(name, func(t *testing.T) {
7575
request := tfsdk.ValidateAttributeRequest{
76-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
76+
AttributePath: path.Root("test"),
7777
AttributeConfig: test.val,
7878
}
7979
response := tfsdk.ValidateAttributeResponse{}

float64validator/type_validation_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66

77
"github.com/google/go-cmp/cmp"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
89
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
910
"github.com/hashicorp/terraform-plugin-framework/types"
10-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1111
)
1212

1313
func TestValidateFloat(t *testing.T) {
@@ -21,31 +21,31 @@ func TestValidateFloat(t *testing.T) {
2121
"invalid-type": {
2222
request: tfsdk.ValidateAttributeRequest{
2323
AttributeConfig: types.Bool{Value: true},
24-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
24+
AttributePath: path.Root("test"),
2525
},
2626
expectedFloat64: 0.0,
2727
expectedOk: false,
2828
},
2929
"float64-null": {
3030
request: tfsdk.ValidateAttributeRequest{
3131
AttributeConfig: types.Float64{Null: true},
32-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
32+
AttributePath: path.Root("test"),
3333
},
3434
expectedFloat64: 0.0,
3535
expectedOk: false,
3636
},
3737
"float64-value": {
3838
request: tfsdk.ValidateAttributeRequest{
3939
AttributeConfig: types.Float64{Value: 1.2},
40-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
40+
AttributePath: path.Root("test"),
4141
},
4242
expectedFloat64: 1.2,
4343
expectedOk: true,
4444
},
4545
"float64-unknown": {
4646
request: tfsdk.ValidateAttributeRequest{
4747
AttributeConfig: types.Float64{Unknown: true},
48-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
48+
AttributePath: path.Root("test"),
4949
},
5050
expectedFloat64: 0.0,
5151
expectedOk: false,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.17
44

55
require (
66
github.com/google/go-cmp v0.5.8
7-
github.com/hashicorp/terraform-plugin-framework v0.9.0
7+
github.com/hashicorp/terraform-plugin-framework v0.9.1-0.20220627174514-5a338a7dd906
88
github.com/hashicorp/terraform-plugin-go v0.9.1
99
)
1010

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
6565
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
6666
github.com/hashicorp/terraform-plugin-framework v0.9.0 h1:vOKG9+keJv062zGhXFgfOFEuGcfgV6LHciwleFTSek0=
6767
github.com/hashicorp/terraform-plugin-framework v0.9.0/go.mod h1:ActelD2V6yt2m0MwIX4jESGDYJ573rAvZswGjSGm1rY=
68+
github.com/hashicorp/terraform-plugin-framework v0.9.1-0.20220627174514-5a338a7dd906 h1:Y9JWkRpLhbJfdN85Dx+joLWRiwzLlZQkhf1qSbyPJI8=
69+
github.com/hashicorp/terraform-plugin-framework v0.9.1-0.20220627174514-5a338a7dd906/go.mod h1:ActelD2V6yt2m0MwIX4jESGDYJ573rAvZswGjSGm1rY=
6870
github.com/hashicorp/terraform-plugin-go v0.9.1 h1:vXdHaQ6aqL+OF076nMSBV+JKPdmXlzG5mzVDD04WyPs=
6971
github.com/hashicorp/terraform-plugin-go v0.9.1/go.mod h1:ItjVSlQs70otlzcCwlPcU8FRXLdO973oYFRZwAOxy8M=
7072
github.com/hashicorp/terraform-plugin-log v0.4.0/go.mod h1:9KclxdunFownr4pIm1jdmwKRmE4d6HVG2c9XDq47rpg=

helpers/validatordiag/diag.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import (
55
"unicode/utf8"
66

77
"github.com/hashicorp/terraform-plugin-framework/diag"
8-
"github.com/hashicorp/terraform-plugin-go/tftypes"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
99
)
1010

1111
// InvalidAttributeValueDiagnostic returns an error Diagnostic to be used when an attribute has an invalid value.
12-
func InvalidAttributeValueDiagnostic(path *tftypes.AttributePath, description string, value string) diag.Diagnostic {
12+
func InvalidAttributeValueDiagnostic(path path.Path, description string, value string) diag.Diagnostic {
1313
return diag.NewAttributeErrorDiagnostic(
1414
path,
1515
"Invalid Attribute Value",
@@ -18,7 +18,7 @@ func InvalidAttributeValueDiagnostic(path *tftypes.AttributePath, description st
1818
}
1919

2020
// InvalidAttributeValueLengthDiagnostic returns an error Diagnostic to be used when an attribute's value has an invalid length.
21-
func InvalidAttributeValueLengthDiagnostic(path *tftypes.AttributePath, description string, value string) diag.Diagnostic {
21+
func InvalidAttributeValueLengthDiagnostic(path path.Path, description string, value string) diag.Diagnostic {
2222
return diag.NewAttributeErrorDiagnostic(
2323
path,
2424
"Invalid Attribute Value Length",
@@ -27,7 +27,7 @@ func InvalidAttributeValueLengthDiagnostic(path *tftypes.AttributePath, descript
2727
}
2828

2929
// InvalidAttributeValueMatchDiagnostic returns an error Diagnostic to be used when an attribute's value has an invalid match.
30-
func InvalidAttributeValueMatchDiagnostic(path *tftypes.AttributePath, description string, value string) diag.Diagnostic {
30+
func InvalidAttributeValueMatchDiagnostic(path path.Path, description string, value string) diag.Diagnostic {
3131
return diag.NewAttributeErrorDiagnostic(
3232
path,
3333
"Invalid Attribute Value Match",
@@ -36,7 +36,7 @@ func InvalidAttributeValueMatchDiagnostic(path *tftypes.AttributePath, descripti
3636
}
3737

3838
// InvalidAttributeSchemaDiagnostic returns an error Diagnostic to be used when a schemavalidator of attributes is invalid.
39-
func InvalidAttributeSchemaDiagnostic(path *tftypes.AttributePath, description string) diag.Diagnostic {
39+
func InvalidAttributeSchemaDiagnostic(path path.Path, description string) diag.Diagnostic {
4040
return diag.NewAttributeErrorDiagnostic(
4141
path,
4242
"Invalid Attribute Combination",
@@ -45,7 +45,7 @@ func InvalidAttributeSchemaDiagnostic(path *tftypes.AttributePath, description s
4545
}
4646

4747
// InvalidAttributeTypeDiagnostic returns an error Diagnostic to be used when an attribute has an invalid type.
48-
func InvalidAttributeTypeDiagnostic(path *tftypes.AttributePath, description string, value string) diag.Diagnostic {
48+
func InvalidAttributeTypeDiagnostic(path path.Path, description string, value string) diag.Diagnostic {
4949
return diag.NewAttributeErrorDiagnostic(
5050
path,
5151
"Invalid Attribute Type",

int64validator/at_least_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
9+
"github.com/hashicorp/terraform-plugin-framework/path"
910
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
11-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1212
)
1313

1414
func TestAtLeastValidator(t *testing.T) {
@@ -51,7 +51,7 @@ func TestAtLeastValidator(t *testing.T) {
5151
name, test := name, test
5252
t.Run(name, func(t *testing.T) {
5353
request := tfsdk.ValidateAttributeRequest{
54-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
54+
AttributePath: path.Root("test"),
5555
AttributeConfig: test.val,
5656
}
5757
response := tfsdk.ValidateAttributeResponse{}

int64validator/at_most_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
9+
"github.com/hashicorp/terraform-plugin-framework/path"
910
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
11-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1212
)
1313

1414
func TestAtMostValidator(t *testing.T) {
@@ -51,7 +51,7 @@ func TestAtMostValidator(t *testing.T) {
5151
name, test := name, test
5252
t.Run(name, func(t *testing.T) {
5353
request := tfsdk.ValidateAttributeRequest{
54-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
54+
AttributePath: path.Root("test"),
5555
AttributeConfig: test.val,
5656
}
5757
response := tfsdk.ValidateAttributeResponse{}

int64validator/between_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
88
"github.com/hashicorp/terraform-plugin-framework/attr"
9+
"github.com/hashicorp/terraform-plugin-framework/path"
910
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1011
"github.com/hashicorp/terraform-plugin-framework/types"
11-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1212
)
1313

1414
func TestBetweenValidator(t *testing.T) {
@@ -68,7 +68,7 @@ func TestBetweenValidator(t *testing.T) {
6868
name, test := name, test
6969
t.Run(name, func(t *testing.T) {
7070
request := tfsdk.ValidateAttributeRequest{
71-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
71+
AttributePath: path.Root("test"),
7272
AttributeConfig: test.val,
7373
}
7474
response := tfsdk.ValidateAttributeResponse{}

int64validator/type_validation_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66

77
"github.com/google/go-cmp/cmp"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
89
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
910
"github.com/hashicorp/terraform-plugin-framework/types"
10-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1111
)
1212

1313
func TestValidateInt(t *testing.T) {
@@ -21,31 +21,31 @@ func TestValidateInt(t *testing.T) {
2121
"invalid-type": {
2222
request: tfsdk.ValidateAttributeRequest{
2323
AttributeConfig: types.Bool{Value: true},
24-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
24+
AttributePath: path.Root("test"),
2525
},
2626
expectedInt64: 0.0,
2727
expectedOk: false,
2828
},
2929
"int64-null": {
3030
request: tfsdk.ValidateAttributeRequest{
3131
AttributeConfig: types.Int64{Null: true},
32-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
32+
AttributePath: path.Root("test"),
3333
},
3434
expectedInt64: 0.0,
3535
expectedOk: false,
3636
},
3737
"int64-value": {
3838
request: tfsdk.ValidateAttributeRequest{
3939
AttributeConfig: types.Int64{Value: 123},
40-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
40+
AttributePath: path.Root("test"),
4141
},
4242
expectedInt64: 123,
4343
expectedOk: true,
4444
},
4545
"int64-unknown": {
4646
request: tfsdk.ValidateAttributeRequest{
4747
AttributeConfig: types.Int64{Unknown: true},
48-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
48+
AttributePath: path.Root("test"),
4949
},
5050
expectedInt64: 0.0,
5151
expectedOk: false,

listvalidator/size_at_least_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66

77
"github.com/hashicorp/terraform-plugin-framework/attr"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
89
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
910
"github.com/hashicorp/terraform-plugin-framework/types"
10-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1111
)
1212

1313
func TestSizeAtLeastValidator(t *testing.T) {
@@ -72,7 +72,7 @@ func TestSizeAtLeastValidator(t *testing.T) {
7272
name, test := name, test
7373
t.Run(name, func(t *testing.T) {
7474
request := tfsdk.ValidateAttributeRequest{
75-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
75+
AttributePath: path.Root("test"),
7676
AttributeConfig: test.val,
7777
}
7878
response := tfsdk.ValidateAttributeResponse{}

listvalidator/size_at_most_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66

77
"github.com/hashicorp/terraform-plugin-framework/attr"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
89
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
910
"github.com/hashicorp/terraform-plugin-framework/types"
10-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1111
)
1212

1313
func TestSizeAtMostValidator(t *testing.T) {
@@ -75,7 +75,7 @@ func TestSizeAtMostValidator(t *testing.T) {
7575
name, test := name, test
7676
t.Run(name, func(t *testing.T) {
7777
request := tfsdk.ValidateAttributeRequest{
78-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
78+
AttributePath: path.Root("test"),
7979
AttributeConfig: test.val,
8080
}
8181
response := tfsdk.ValidateAttributeResponse{}

listvalidator/size_between_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"testing"
66

77
"github.com/hashicorp/terraform-plugin-framework/attr"
8+
"github.com/hashicorp/terraform-plugin-framework/path"
89
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
910
"github.com/hashicorp/terraform-plugin-framework/types"
10-
"github.com/hashicorp/terraform-plugin-go/tftypes"
1111
)
1212

1313
func TestSizeBetweenValidator(t *testing.T) {
@@ -115,7 +115,7 @@ func TestSizeBetweenValidator(t *testing.T) {
115115
name, test := name, test
116116
t.Run(name, func(t *testing.T) {
117117
request := tfsdk.ValidateAttributeRequest{
118-
AttributePath: tftypes.NewAttributePath().WithAttributeName("test"),
118+
AttributePath: path.Root("test"),
119119
AttributeConfig: test.val,
120120
}
121121
response := tfsdk.ValidateAttributeResponse{}

0 commit comments

Comments
 (0)