Skip to content

Commit c338d61

Browse files
Update changelog
1 parent 4d10c17 commit c338d61

File tree

4 files changed

+90
-46
lines changed

4 files changed

+90
-46
lines changed

.changes/1.11.0.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## 1.11.0 (August 06, 2024)
2+
3+
NOTES:
4+
5+
* Framework reflection logic (`Config.Get`, `Plan.Get`, etc.) for structs with
6+
`tfsdk` field tags has been updated to support embedded structs that promote exported
7+
fields. For existing structs that embed unexported structs with exported fields, a tfsdk
8+
ignore tag (``tfsdk:"-"``) can be added to ignore all promoted fields.
9+
10+
For example, the following struct will now return an error diagnostic:
11+
```go
12+
type thingResourceModel struct {
13+
Attr1 types.String `tfsdk:"attr_1"`
14+
Attr2 types.Bool `tfsdk:"attr_2"`
15+
16+
// Previously, this embedded struct was ignored, will now promote underlying fields
17+
embeddedModel
18+
}
19+
20+
type embeddedModel struct {
21+
// No `tfsdk` tag
22+
ExportedField string
23+
}
24+
```
25+
26+
To preserve the original behavior, a tfsdk ignore tag can be added to ignore the entire embedded struct:
27+
```go
28+
type thingResourceModel struct {
29+
Attr1 types.String `tfsdk:"attr_1"`
30+
Attr2 types.Bool `tfsdk:"attr_2"`
31+
32+
// This embedded struct will now be ignored
33+
embeddedModel `tfsdk:"-"`
34+
}
35+
36+
type embeddedModel struct {
37+
ExportedField string
38+
}
39+
```
40+
([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))
41+
42+
ENHANCEMENTS:
43+
44+
* all: Added embedded struct support for object to struct conversions with `tfsdk` tags ([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))
45+

.changes/unreleased/ENHANCEMENTS-20240722-175116.yaml

-6
This file was deleted.

.changes/unreleased/NOTES-20240801-171654.yaml

-40
This file was deleted.

CHANGELOG.md

+45
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
## 1.11.0 (August 06, 2024)
2+
3+
NOTES:
4+
5+
* Framework reflection logic (`Config.Get`, `Plan.Get`, etc.) for structs with
6+
`tfsdk` field tags has been updated to support embedded structs that promote exported
7+
fields. For existing structs that embed unexported structs with exported fields, a tfsdk
8+
ignore tag (``tfsdk:"-"``) can be added to ignore all promoted fields.
9+
10+
For example, the following struct will now return an error diagnostic:
11+
```go
12+
type thingResourceModel struct {
13+
Attr1 types.String `tfsdk:"attr_1"`
14+
Attr2 types.Bool `tfsdk:"attr_2"`
15+
16+
// Previously, this embedded struct was ignored, will now promote underlying fields
17+
embeddedModel
18+
}
19+
20+
type embeddedModel struct {
21+
// No `tfsdk` tag
22+
ExportedField string
23+
}
24+
```
25+
26+
To preserve the original behavior, a tfsdk ignore tag can be added to ignore the entire embedded struct:
27+
```go
28+
type thingResourceModel struct {
29+
Attr1 types.String `tfsdk:"attr_1"`
30+
Attr2 types.Bool `tfsdk:"attr_2"`
31+
32+
// This embedded struct will now be ignored
33+
embeddedModel `tfsdk:"-"`
34+
}
35+
36+
type embeddedModel struct {
37+
ExportedField string
38+
}
39+
```
40+
([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))
41+
42+
ENHANCEMENTS:
43+
44+
* all: Added embedded struct support for object to struct conversions with `tfsdk` tags ([#1021](https://github.com/hashicorp/terraform-plugin-framework/issues/1021))
45+
146
## 1.10.0 (July 09, 2024)
247

348
FEATURES:

0 commit comments

Comments
 (0)