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

Embedded structs in models #941

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

skyscrapr
Copy link

@skyscrapr skyscrapr commented Mar 5, 2024

A number of requests have been made to support embedded structs in models.
#242 has been open for over 3 years.

However I understand this might be a fairly big effort to implement.
Therefore I attempted a minimal change to implement a solution.

See what you think and if appropriate happy to work to get it merged.
Would help me on some other providers that I'm building.

The idea is to allow this type of struct embedding:

type SimpleStruct struct {
	Field1 string `tfsdk:"field1"`
	Field2 int    `tfsdk:"field2"`
	Field3 bool   `tfsdk:"field3"`
}

type ComplexStruct struct {
	SimpleStruct
	Field4 string `tfsdk:"field4"`
}

@skyscrapr skyscrapr requested a review from a team as a code owner March 5, 2024 05:25
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 5, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants