File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
modules/swagger-parser/src/main/java/io/swagger/parser/util Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 33import com .fasterxml .jackson .databind .JsonNode ;
44import io .swagger .util .Json ;
55import io .swagger .util .Yaml ;
6+ import org .yaml .snakeyaml .constructor .SafeConstructor ;
67
78import java .io .IOException ;
89
@@ -57,12 +58,12 @@ private static boolean isJson(String contents) {
5758 }
5859
5960 public static JsonNode readYamlTree (String contents ) {
60- org .yaml .snakeyaml .Yaml yaml = new org .yaml .snakeyaml .Yaml ();
61+ org .yaml .snakeyaml .Yaml yaml = new org .yaml .snakeyaml .Yaml (new SafeConstructor () );
6162 return Json .mapper ().convertValue (yaml .load (contents ), JsonNode .class );
6263 }
6364
6465 public static <T > T readYamlValue (String contents , Class <T > expectedType ) {
65- org .yaml .snakeyaml .Yaml yaml = new org .yaml .snakeyaml .Yaml ();
66+ org .yaml .snakeyaml .Yaml yaml = new org .yaml .snakeyaml .Yaml (new SafeConstructor () );
6667 return Json .mapper ().convertValue (yaml .load (contents ), expectedType );
6768 }
6869}
You can’t perform that action at this time.
0 commit comments