Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tftypes: Type should implement AttributePathStepper #110

Closed
bflad opened this issue Sep 24, 2021 · 1 comment · Fixed by #163
Closed

tftypes: Type should implement AttributePathStepper #110

bflad opened this issue Sep 24, 2021 · 1 comment · Fixed by #163
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Sep 24, 2021

terraform-plugin-go version

v0.4.0

Use cases

Given this code in the downstream terraform-plugin-framework:

https://github.com/hashicorp/terraform-plugin-framework/blob/2cedf45c2bf94bfb82ff65b1402b3fd75a806aa4/tfsdk/plan.go#L199-L284

It would not correctly be able handle cases where the schema (framework's) type is DynamicPseudoType, but the value itself is concrete.

Attempted solutions

Looking up types via the wrapping type system, however this will only work as long as the framework's type system is 1:1 with Terraform's concrete type system. In the case of DynamicPseudoType constraints, this assumption can no longer work.

Proposal

Allow Type to be walked by attribute path by implementing AttributePathStepper. This would allow downstream logic to use tftypes.WalkAttributePath(/* tftypes.Type */, /* *tftypes.AttributePath */) to correctly determine a type at a given path.

References

@bflad bflad added the enhancement New feature or request label Sep 24, 2021
bflad added a commit that referenced this issue Mar 9, 2022
Reference: #110

This will allow implementations to step into `Type` via `AttributePath` similar to `Value`, which can simplify data handling logic.
@bflad bflad self-assigned this Mar 14, 2022
@bflad bflad added this to the v0.9.0 milestone Mar 14, 2022
bflad added a commit that referenced this issue Mar 14, 2022
Reference: #110

This will allow implementations to step into `Type` via `AttributePath` similar to `Value`, which can simplify data handling logic.
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant