@@ -70,7 +70,7 @@ func FromUnknownable(ctx context.Context, typ attr.Type, val Unknownable, path *
70
70
tfVal := tftypes .NewValue (typ .TerraformType (ctx ), tftypes .UnknownValue )
71
71
72
72
if typeWithValidate , ok := typ .(attr.TypeWithValidate ); ok {
73
- diags .Append (typeWithValidate .Validate (ctx , tfVal )... )
73
+ diags .Append (typeWithValidate .Validate (ctx , tfVal , path )... )
74
74
75
75
if diags .HasError () {
76
76
return nil , diags
@@ -91,7 +91,7 @@ func FromUnknownable(ctx context.Context, typ attr.Type, val Unknownable, path *
91
91
tfVal := tftypes .NewValue (typ .TerraformType (ctx ), val .GetValue (ctx ))
92
92
93
93
if typeWithValidate , ok := typ .(attr.TypeWithValidate ); ok {
94
- diags .Append (typeWithValidate .Validate (ctx , tfVal )... )
94
+ diags .Append (typeWithValidate .Validate (ctx , tfVal , path )... )
95
95
96
96
if diags .HasError () {
97
97
return nil , diags
@@ -164,7 +164,7 @@ func FromNullable(ctx context.Context, typ attr.Type, val Nullable, path *tftype
164
164
tfVal := tftypes .NewValue (typ .TerraformType (ctx ), nil )
165
165
166
166
if typeWithValidate , ok := typ .(attr.TypeWithValidate ); ok {
167
- diags .Append (typeWithValidate .Validate (ctx , tfVal )... )
167
+ diags .Append (typeWithValidate .Validate (ctx , tfVal , path )... )
168
168
169
169
if diags .HasError () {
170
170
return nil , diags
@@ -185,7 +185,7 @@ func FromNullable(ctx context.Context, typ attr.Type, val Nullable, path *tftype
185
185
tfVal := tftypes .NewValue (typ .TerraformType (ctx ), val .GetValue (ctx ))
186
186
187
187
if typeWithValidate , ok := typ .(attr.TypeWithValidate ); ok {
188
- diags .Append (typeWithValidate .Validate (ctx , tfVal )... )
188
+ diags .Append (typeWithValidate .Validate (ctx , tfVal , path )... )
189
189
190
190
if diags .HasError () {
191
191
return nil , diags
@@ -256,7 +256,7 @@ func FromValueCreator(ctx context.Context, typ attr.Type, val tftypes.ValueCreat
256
256
tfVal := tftypes .NewValue (typ .TerraformType (ctx ), raw )
257
257
258
258
if typeWithValidate , ok := typ .(attr.TypeWithValidate ); ok {
259
- diags .Append (typeWithValidate .Validate (ctx , tfVal )... )
259
+ diags .Append (typeWithValidate .Validate (ctx , tfVal , path )... )
260
260
261
261
if diags .HasError () {
262
262
return nil , diags
@@ -279,7 +279,7 @@ func NewAttributeValue(ctx context.Context, typ attr.Type, val tftypes.Value, ta
279
279
var diags diag.Diagnostics
280
280
281
281
if typeWithValidate , ok := typ .(attr.TypeWithValidate ); ok {
282
- diags .Append (typeWithValidate .Validate (ctx , val )... )
282
+ diags .Append (typeWithValidate .Validate (ctx , val , path )... )
283
283
284
284
if diags .HasError () {
285
285
return target , diags
@@ -319,7 +319,7 @@ func FromAttributeValue(ctx context.Context, typ attr.Type, val attr.Value, path
319
319
return val , append (diags , toTerraformValueErrorDiag (err , path ))
320
320
}
321
321
322
- diags .Append (typeWithValidate .Validate (ctx , tftypes .NewValue (tfType , tfVal ))... )
322
+ diags .Append (typeWithValidate .Validate (ctx , tftypes .NewValue (tfType , tfVal ), path )... )
323
323
324
324
if diags .HasError () {
325
325
return val , diags
0 commit comments