t: test
Pay attention that it's a tab after :
,and I used this YAML parser to test whether it's valid or not(IMO it's not valid):
Array
(
[t] => test
)
A YAML file use spaces as indentation, you can use 2 or 4 spaces for indentation, but no tab. In other words, tab indentation is forbidden: Why does YAML forbid tabs? Tabs have been outlawed since they are treated differently by different editors and tools.
The error text states this is an indentation error, and you fix it by adding an additional two spaces before each dash ( - ) character. If you don't know why those are errors, read my YAML for Ansible article.
Key-Value Pairs. The YAML above defines four keys - first_name , last_name , age_years , and home - with their four respective values. Values can be character strings, numeric (integer, floating point, or scientific representation), Boolean ( true or false ), or more complex nested types (see below).
Tab adds indentation, Shift+Tab removes indentation. You don't need to do that. Yaml doesn't care. Just leave the spaces in.
According to the specification, both tab (U+0009) and space (U+0020) are considered “white space characters” that may be used to delimit tokens.
So what makes you think it's illegal in that context? Especially considering that example 6.3 makes it clear that it's valid:
Example 6.3. Separation Spaces
-·foo:→·bar - -·baz -→baz
(·
denotes a space (U+0020), while →
denotes a tab character (U+0009)).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With