Skip to content

Conversation

cam72cam
Copy link

A common pattern that does not currently work for decoding hcl is:

type Base struct {
    Field string `hcl:"my_field"`
}

type Variant struct {
    Base
    Value int `hcl:"my_value"`
}

This is fixed by making some recursive tweaks to schema.go and corresponding changes in decode and encode.

This code is functional for decode, but still requires encode changes as well as test coverage. I may end up refactoring this a bit as I fiddle with encode, but the core functionality is there.

Still needs encoder changes and tests
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 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.

2 participants