Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-tf-provider-devex committed Aug 6, 2024
1 parent 4d10c17 commit c338d61
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 46 deletions.
45 changes: 45 additions & 0 deletions .changes/1.11.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## 1.11.0 (August 06, 2024)

NOTES:

* Framework reflection logic (`Config.Get`, `Plan.Get`, etc.) for structs with
`tfsdk` field tags has been updated to support embedded structs that promote exported
fields. For existing structs that embed unexported structs with exported fields, a tfsdk
ignore tag (``tfsdk:"-"``) can be added to ignore all promoted fields.

For example, the following struct will now return an error diagnostic:
```go
type thingResourceModel struct {
Attr1 types.String `tfsdk:"attr_1"`
Attr2 types.Bool `tfsdk:"attr_2"`

// Previously, this embedded struct was ignored, will now promote underlying fields
embeddedModel
}

type embeddedModel struct {
// No `tfsdk` tag
ExportedField string
}
```

To preserve the original behavior, a tfsdk ignore tag can be added to ignore the entire embedded struct:
```go
type thingResourceModel struct {
Attr1 types.String `tfsdk:"attr_1"`
Attr2 types.Bool `tfsdk:"attr_2"`

// This embedded struct will now be ignored
embeddedModel `tfsdk:"-"`
}

type embeddedModel struct {
ExportedField string
}
```
([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))

ENHANCEMENTS:

* all: Added embedded struct support for object to struct conversions with `tfsdk` tags ([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))

6 changes: 0 additions & 6 deletions .changes/unreleased/ENHANCEMENTS-20240722-175116.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions .changes/unreleased/NOTES-20240801-171654.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
## 1.11.0 (August 06, 2024)

NOTES:

* Framework reflection logic (`Config.Get`, `Plan.Get`, etc.) for structs with
`tfsdk` field tags has been updated to support embedded structs that promote exported
fields. For existing structs that embed unexported structs with exported fields, a tfsdk
ignore tag (``tfsdk:"-"``) can be added to ignore all promoted fields.

For example, the following struct will now return an error diagnostic:
```go
type thingResourceModel struct {
Attr1 types.String `tfsdk:"attr_1"`
Attr2 types.Bool `tfsdk:"attr_2"`

// Previously, this embedded struct was ignored, will now promote underlying fields
embeddedModel
}

type embeddedModel struct {
// No `tfsdk` tag
ExportedField string
}
```

To preserve the original behavior, a tfsdk ignore tag can be added to ignore the entire embedded struct:
```go
type thingResourceModel struct {
Attr1 types.String `tfsdk:"attr_1"`
Attr2 types.Bool `tfsdk:"attr_2"`

// This embedded struct will now be ignored
embeddedModel `tfsdk:"-"`
}

type embeddedModel struct {
ExportedField string
}
```
([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))

ENHANCEMENTS:

* all: Added embedded struct support for object to struct conversions with `tfsdk` tags ([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))

## 1.10.0 (July 09, 2024)

FEATURES:
Expand Down

0 comments on commit c338d61

Please sign in to comment.