google/go-jsonnet

parseYaml inserts null when document stream starts with a comment

0xd3e opened this issue · 0 comments

0xd3e commented

I just found out that a null value is added to the array when I parse a stream of YAML documents that starts with a comment.

YAML

# Test
---
foo: bar
---
baz: cuux

Jsonnet

std.parseYaml(importstr 'test.yaml')

Result

[
   null,
   {
      "foo": "bar"
   },
   {
      "baz": "cuux"
   }
]

Expected Result

[
   {
      "foo": "bar"
   },
   {
      "baz": "cuux"
   }
]

Current Workaround

std.prune(std.parseYaml(importstr 'test.yaml'))