Skip to content

Commit d01bebb

Browse files
authored
Fixup JSON tags on field attribute model (#552)
* Fixup field attr json tags * Changelog
1 parent 5c608c4 commit d01bebb

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Import all relevant attributes during `elasticstack_fleet_output` import ([#522](https://github.com/elastic/terraform-provider-elasticstack/pull/522))
1010
- Fix issue when setting `override` in `elasticstack_kibana_data_view` resource ([#550](https://github.com/elastic/terraform-provider-elasticstack/pull/550))
1111
- Fixup typos in `elasticstack_elasticsearch_transform` and `elasticstack_kibana_security_role` docs ([#551](https://github.com/elastic/terraform-provider-elasticstack/pull/551))
12+
- Fix issue when setting `field_attrs` in `elasticstack_kibana_data_view` resource ([#552](https://github.com/elastic/terraform-provider-elasticstack/pull/552))
1213

1314
## [0.11.0] - 2023-12-12
1415

internal/kibana/data_view/acc_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func TestAccResourceDataView(t *testing.T) {
3939
resource.TestCheckResourceAttr("elasticstack_kibana_data_view.dv", "data_view.field_formats.event_time.id", "date_nanos"),
4040
resource.TestCheckResourceAttr("elasticstack_kibana_data_view.dv", "data_view.field_formats.machine.ram.params.pattern", "0,0.[000] b"),
4141
resource.TestCheckResourceAttr("elasticstack_kibana_data_view.dv", "data_view.runtime_field_map.runtime_shape_name.script_source", "emit(doc['shape_name'].value)"),
42+
resource.TestCheckResourceAttr("elasticstack_kibana_data_view.dv", "data_view.field_attrs.ingest_failure.custom_label", "error.ingest_failure"),
4243
),
4344
},
4445
{
@@ -107,6 +108,9 @@ resource "elasticstack_kibana_data_view" "dv" {
107108
script_source = "emit(doc['shape_name'].value)"
108109
}
109110
}
111+
field_attrs = {
112+
ingest_failure = { custom_label = "error.ingest_failure", count = 6 },
113+
}
110114
}
111115
}`, indexName, indexName, indexName)
112116
}

internal/kibana/data_view/schema.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ type apiRuntimeFieldV0 struct {
604604
}
605605

606606
type fieldAttr struct {
607-
CustomLabel *string `tfsdk:"customLabel"`
608-
Count *int64 `tfsdk:"count"`
607+
CustomLabel *string `json:"customLabel"`
608+
Count *int64 `json:"count"`
609609
}
610610

611611
type runtimeField struct {

0 commit comments

Comments
 (0)