-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Module version
1.15.1
Use-cases
resp.Definition = function.Definition{
Parameters: []function.Parameter{
function.MapParameter{
ElementType: types.DynamicType,
},
},
Return: function.MapReturn{ElementType: types.DynamicType},
}Error: Failed to load plugin schemas
Error while loading schemas for plugin components: Failed to obtain provider
schema: Could not load the schema for provider
registry.terraform.io/hashicorp/stdlib: failed to retrieve schema from
provider "registry.terraform.io/hashicorp/stdlib": 2 problems:
Invalid Function Definition: When validating the function definition, an
implementation issue was found. This is always an issue with the provider and
should be reported to the provider developers.
Return contains a collection type with a nested dynamic type.
Dynamic types inside of collections are not currently supported in
terraform-plugin-framework. If underlying dynamic values are required,
replace the return definition with DynamicReturn instead.
Invalid Function Definition: When validating the function definition, an
implementation issue was found. This is always an issue with the provider and
should be reported to the provider developers.
Parameter "map" at position 0 contains a collection type with a nested
dynamic type.
Dynamic types inside of collections are not currently supported in
terraform-plugin-framework. If underlying dynamic values are required,
replace the "map" parameter definition with DynamicParameter instead...
Attempted Solutions
It actually already works for custom functions, but is limited by schema restrictions.
Proposal
Allow this for custom functions if possible.
References
n/a
Summary: my unit test case matrix passes (but of course acceptance tests fail) for custom functions with dynamic types inside of collections, and everything behaves as expected as long as the type within the collection is uniform (otherwise the type validation fails which is expected behavior). I understand there is a schema restriction here, but everything is functioning correctly for custom functions, and so I was wondering if the restriction could be lifted solely for custom functions.
I also understand that dynamic types are not equivalent to generics, but rather more of an any type, but with type checking on UnderlyingValue this is not a roadblock.
Thank you.