Skip to content

Commit

Permalink
#183 - support YAML aliases in validation
Browse files Browse the repository at this point in the history
1. Aliases are correctly dereferenced and expanded in-place by
SnakeYaml. 
2. Then we convert the object (usually it's a `Map`) to a string, which
is passed to Jackson's Mapper.

I hope to find a better way of transforming Snake-YAML results into a
`JsonNode`
  • Loading branch information
tfesenko committed Aug 18, 2016
1 parent 8d92c18 commit 95d13aa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ private void parseYaml(String content) {

private void parseJson(String content) {
try {
jsonContent = mapper.readTree(content);
Object expandedYamlObject = new com.fasterxml.jackson.dataformat.yaml.snakeyaml.Yaml().load(content);
jsonContent = mapper.readTree(mapper.writeValueAsString(expandedYamlObject));
jsonError = null;
} catch (Exception e) {
jsonContent = null;
Expand Down

0 comments on commit 95d13aa

Please sign in to comment.