Skip to content

Commit 07d458c

Browse files
committed
Fixup field attr json tags
1 parent e4f23e8 commit 07d458c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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)