-
Notifications
You must be signed in to change notification settings - Fork 95
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
"Follow" Embedded Structs #242
Comments
This issue appears to be specific to terraform-plugin-framework, so going to transfer it over there. |
I would love this feature. @frankgreco If you still have the workaround, would you be willing to share it? |
@skirsten I gave up and restructured my Go types. TBH I'm kind of disappointed in the level of engagement these GH issues get from developing trying to try the new framework. |
Additional HashiCorp Discuss references:
Will bring this up during our team's next regularly scheduled triage meeting to get it on the schedule. To set expectations, efforts (reviews or implementations) in this area may not happen until late April as we already have other features queued up in the meantime. |
|
Time has passed and this is a useful feature. @bflad, has the team had a chance to look into merging the PR implementing this? I'm facing the same issue today. |
UP ? |
I just got done refactoring a provider because I never in 100 years would've thought that embedding a struct would not be supported. |
This is a much needed feature. I am also facing the need of refactoring a complete provider because I cannot share a BaseModel between datasource and resource, if this feature is not implemented |
+1 🙏 |
@bflad @austinvalle can #941 be merged soon? It's somewhat odd that a so much vital feature, that helps to write clean and maintainable code, is not resolved in 4 (!!!) years. |
Hi all 👋🏻 , we've merged a solution to this issue which will release with In the meantime, if you'd like to test the feature out, you can use the latest commit from go get -u github.com/hashicorp/terraform-plugin-framework@main The eventual website documentation can be found here: https://github.com/hashicorp/terraform-plugin-framework/blob/main/website/docs/plugin/framework/handling-data/types/object.mdx#struct-embedding |
terraform-plugin-go version
Use cases
Consider the following type 👇🏼
In
JSON
,address, mac, fromPort, and toPort
would all be at the same level. I want this identical behavior fortdsdk
. Currently, it'll complain that the embedded*Port
field doesn't contain a tag.Attempted solutions
I have a workaround worth about 100 lines of code that implements
FromTerraform5Value
andToTerraform5Value
.Proposal
Implement the same behavior as
encoding/json
so that......will natively be unmarshaled into the aforementioned type.
References
The text was updated successfully, but these errors were encountered: