From 0e3787032c47f641f1b1609970da74958fb8ac98 Mon Sep 17 00:00:00 2001 From: neuroevolutus <19356702+neuroevolutus@users.noreply.github.com> Date: Sun, 12 Mar 2023 14:16:25 -0500 Subject: [PATCH] Clarify use of brackets when `read`ing with special characters --- pkg/yqlib/doc/operators/traverse-read.md | 4 ++-- pkg/yqlib/operator_traverse_path_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/yqlib/doc/operators/traverse-read.md b/pkg/yqlib/doc/operators/traverse-read.md index 7e373e4e..fefe24df 100644 --- a/pkg/yqlib/doc/operators/traverse-read.md +++ b/pkg/yqlib/doc/operators/traverse-read.md @@ -51,7 +51,7 @@ will output ``` ## Special characters -Use quotes with brackets around path elements with special characters +Use quotes with square brackets around path elements with special characters Given a sample.yml file of: ```yaml @@ -83,7 +83,7 @@ apple ``` ## Keys with spaces -Use quotes with brackets around path elements with special characters +Use quotes with square brackets around path elements with special characters Given a sample.yml file of: ```yaml diff --git a/pkg/yqlib/operator_traverse_path_test.go b/pkg/yqlib/operator_traverse_path_test.go index 8d3e94ad..e82acc2b 100644 --- a/pkg/yqlib/operator_traverse_path_test.go +++ b/pkg/yqlib/operator_traverse_path_test.go @@ -116,7 +116,7 @@ var traversePathOperatorScenarios = []expressionScenario{ }, { description: "Special characters", - subdescription: "Use quotes with brackets around path elements with special characters", + subdescription: "Use quotes with square brackets around path elements with special characters", document: `{"{}": frog}`, expression: `.["{}"]`, expected: []string{ @@ -133,7 +133,7 @@ var traversePathOperatorScenarios = []expressionScenario{ }, { description: "Keys with spaces", - subdescription: "Use quotes with brackets around path elements with special characters", + subdescription: "Use quotes with square brackets around path elements with special characters", document: `{"red rabbit": frog}`, expression: `.["red rabbit"]`, expected: []string{