Skip to content

std.parseYaml #460

Closed
Closed
@sbarzowski

Description

@sbarzowski

Importing YAML files was requested by multiple people, it was proposed in #196 and popped up in various discussions. Also YAML files are very popular in the Kubernetes communities which are heavy users of jsonnet.

Implementing library function (probably builtin) parseYaml would allow processing yaml files with jsonnet. It would require importing it first through importstr then invoking parseYaml on the result. Later we can think about automatically applying it based on extension or something.

Relatedly imporstr and parseJson should be used rather than import when dealing with json (not jsonnet) files, especially if they are not 100% trusted (consider imporstr "/etc/passwd").

Challenges:

  • YAML is complicated, making it very difficult to keep byte-for-byte compatibility
  • The existing parsers may be slightly non-compliant
  • Safe vs unsafe yaml

@benley, @nikolay

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions