PSYaml icon indicating copy to clipboard operation
PSYaml copied to clipboard

Does not properly convert nested lists

Open btusakul opened this issue 7 years ago • 1 comments

Given a file with this content:

- test1
-   - test2
    - test3

the expected output from piping this file's content to ConvertFrom-Yaml would be a list with 'test1' and a nested list with 'test2' and 'test3'. This should be the proper formatting for nested lists in YAML and converting this YAML file in Python, with the PyYAML module, exhibits this behavior.

However, the ConvertFrom-Yaml cmdlet returns a list with 'test1', 'test2', and 'test3'.

btusakul avatar Jun 19 '18 22:06 btusakul

Yes, this is valid yaml and should be represented as you describe. it is missing the second '-' on that line. Unfortunately this is happening in aaubry's YamlDotNet library. Curiously, the parser appears to get it right but at some point the result is converted to a string array with three components.

Phil-Factor avatar Mar 22 '19 14:03 Phil-Factor