Skip to content

Guidance: Nested indexer [] within flow sequence #423

Closed Answered by eemeli
evilrobot-01 asked this question in Q&A
Discussion options

You must be logged in to vote

Short answer: not really, because the latter "required syntax" is not valid YAML.

Within flow collections, plain scalars cannot contain [] or {} characters: https://yaml.org/spec/1.2.2/#733-plain-style

They're fine is a block collection though:

YAML.parse(`
args:
  - $variable[0]
  - 100
`)
// { args: [ '$variable[0]', 100 ] }

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by eemeli
Comment options

You must be logged in to vote
1 reply
@eemeli
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants