diff --git a/internal/command/jsonchecks/checks.go b/internal/command/jsonchecks/checks.go index 8590da9be2..892dcba325 100644 --- a/internal/command/jsonchecks/checks.go +++ b/internal/command/jsonchecks/checks.go @@ -70,6 +70,8 @@ func MarshalCheckStates(results *states.CheckResults) []byte { // object in the configuration even if Terraform Core encountered an error // before being able to determine the dynamic instances of the checkable object. type checkResultStatic struct { + ExperimentalNote experimentalNote `json:"//"` + // Address is the address of the checkable object this result relates to. Address staticObjectAddr `json:"address"` @@ -114,3 +116,9 @@ type checkProblem struct { // intentionally an object to allow us to add other data over time, such // as the source location where the failing condition was defined. } + +type experimentalNote struct{} + +func (n experimentalNote) MarshalJSON() ([]byte, error) { + return []byte(`"EXPERIMENTAL: see docs for details"`), nil +} diff --git a/internal/command/jsonchecks/checks_test.go b/internal/command/jsonchecks/checks_test.go index fd8dba8b80..6e0f52da4f 100644 --- a/internal/command/jsonchecks/checks_test.go +++ b/internal/command/jsonchecks/checks_test.go @@ -94,6 +94,7 @@ func TestMarshalCheckStates(t *testing.T) { }, []any{ map[string]any{ + "//": "EXPERIMENTAL: see docs for details", "address": map[string]any{ "kind": "output_value", "module": "module.child", @@ -117,6 +118,7 @@ func TestMarshalCheckStates(t *testing.T) { "status": "fail", }, map[string]any{ + "//": "EXPERIMENTAL: see docs for details", "address": map[string]any{ "kind": "resource", "mode": "managed", @@ -142,6 +144,7 @@ func TestMarshalCheckStates(t *testing.T) { "status": "fail", }, map[string]any{ + "//": "EXPERIMENTAL: see docs for details", "address": map[string]any{ "kind": "output_value", "name": "a", @@ -158,6 +161,7 @@ func TestMarshalCheckStates(t *testing.T) { "status": "fail", }, map[string]any{ + "//": "EXPERIMENTAL: see docs for details", "address": map[string]any{ "kind": "resource", "mode": "managed",