From b6ca782993023df48b8846f513007f93dc98e521 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Wed, 17 Mar 2021 11:43:41 -0400 Subject: [PATCH] documentation: Clarify JSON diagnostic traversal The traversal value is normally a valid HCL string, but can be simplified if a traversal step has a complex index value (e.g. an object). This means it is not always parseable HCL, so this commit updates the documentation to clarify this and explicitly record that we do not guarantee its contents are stable. The purpose of these values is purely for building human-readable UI. --- website/docs/cli/commands/validate.html.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/docs/cli/commands/validate.html.md b/website/docs/cli/commands/validate.html.md index c6436c6af..b6210d697 100644 --- a/website/docs/cli/commands/validate.html.md +++ b/website/docs/cli/commands/validate.html.md @@ -202,7 +202,11 @@ part of the expression which triggered the diagnostic. This is especially useful when using `for_each` or similar constructs, in order to identify exactly which values are responsible for an error. The object has two properties: -* `traversal` (string): An HCL traversal string, such as `var.instance_count`. +* `traversal` (string): An HCL-like traversal string, such as + `var.instance_count`. Complex index key values may be elided, so this will + not always be valid, parseable HCL. The contents of this string are intended + to be human-readable and are subject to change in future versions of + Terraform. * `statement` (string): A short English-language fragment describing the value of the expression when the diagnostic was triggered. The contents of this