terraform-plugin-framework
terraform-plugin-framework copied to clipboard
Consider types Package Alias for basetypes.ObjectAsOptions
Module version
v1.2.0
Use-cases
When calling the (types.Object).As() method (really the (basetypes.ObjectValue).As() method 😉 ), the third parameter is basetypes.ObjectAsOptions. However, unlike everything else for framework-defined types which are aliased in the types package, the ObjectAsOptions type is not aliased, which means developers need to unexpectedly import the basetypes package as well (typically only needed for implementing custom value types). It's a minor annoyance, but since we already did all the work to alias everything else, it seems like this should be included for consistency or to at least reduce some potential confusion about the "new" import.
Proposal
In the types package, add:
// Copied Go documentation...
type ObjectAsOptions = basetypes.ObjectAsOptions
Double check that website documentation which uses types everywhere else switches to types.ObjectAsOptions for consistency.