Consider raising an implementation diagnostic for mismatched CustomType
/ Attributes
combinations
#1049
Labels
bug
Something isn't working
Module version
Relevant provider source code
Terraform Configuration Files
Actual Behavior
When a
CustomType
for a nested attribute or nested block does not match theAttributes
/Blocks
defined underneath, you'll receive an error when decoding any objects from Terraform (most likely, the configuration during validation). This occurs because the provider has an invalid implementation, due to theCustomType
attributes not matching the actual schema attributes. Framework uses the attributes directly forGetProviderSchema
(which is sent to Terraform core), but for all decoding operations, uses the actual type of the schema (including the custom types).This issue exists for all nested attributes and nested blocks that define a custom object type. You'll receive a confusing decoding error that suggests there is a bug in
terraform-plugin-framework
.Expected Behavior
As this is a provider implementation problem, we should have received a more explicit error message indicating that the
CustomType
field does not match theAttributes
provided and that the provider needs to update it's implementation to match the two. This can be returned duringGetProviderSchema
, similar to the other invalid implementation diagnostics we do today.References
List
(orSet
) attribute defines bothElementType
andCustomType
#947The text was updated successfully, but these errors were encountered: