mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-10 16:55:40 +00:00
Clarify use of brackets when reading with special characters
This commit is contained in:
parent
d26dad7117
commit
0e3787032c
@ -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
|
||||
|
||||
@ -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{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user