1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
141 views
by michael-h-5027 (14.8k points)

1 Answer

0 votes

One method would be to convert the YAML file to JSON.

 

function convertYamlToJson(yaml) {
    var yamlReader = new com.fasterxml.jackson.databind.ObjectMapper(new com.fasterxml.jackson.dataformat.yaml.YAMLFactory());
    var obj = yamlReader.readValue(yaml, java.lang.Object);

    var jsonWriter = new com.fasterxml.jackson.databind.ObjectMapper();
    return jsonWriter.writeValueAsString(obj);
}

by michael-h-5027 (14.8k points)
...