Skip to content
Prev Previous commit
Next Next commit
disable map, list works now
  • Loading branch information
Doridian committed Sep 14, 2022
commit 9d56eb0620b26d8fad02f5c8b2f622f6f322b24b
10 changes: 8 additions & 2 deletions internal/fwserver/attribute_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ func TestAttributeValidate(t *testing.T) {
diag.NewAttributeErrorDiagnostic(
path.Root("test"),
"List Type Validation Error",
"An unexpected error was encountered trying to convert an attribute value from the configuration. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
"Error: can't use tftypes.String<\"testvalue\"> as value of List with ElementType types.primitive, can only use tftypes.String values",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
"expected List value, received tftypes.Value with value: tftypes.String<\"testvalue\">",
),
diag.NewAttributeErrorDiagnostic(
path.Root("test"),
"List Type Validation Error",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
"can't unmarshal tftypes.String into *[]tftypes.Value expected []tftypes.Value",
),
},
},
Expand Down
3 changes: 3 additions & 0 deletions types/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func (m MapType) String() string {
// xattr.TypeWithValidate.
func (m MapType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics {
var diags diag.Diagnostics
if true {
return diags
}

if in.Type() == nil {
return diags
Expand Down