Skip to content

parseYaml inserts null when document stream starts with a comment #660

@0xd3e

Description

@0xd3e

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'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions