|
| 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 | + |
1 | 46 | ## 1.10.0 (July 09, 2024)
|
2 | 47 |
|
3 | 48 | FEATURES:
|
|
0 commit comments