File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/main/java/org/commonwl/view/cwl Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 64
64
import com .fasterxml .jackson .databind .node .ArrayNode ;
65
65
import com .fasterxml .jackson .databind .node .ObjectNode ;
66
66
import com .fasterxml .jackson .databind .node .TextNode ;
67
+ import org .yaml .snakeyaml .constructor .SafeConstructor ;
67
68
68
69
/**
69
70
* Provides CWL parsing for workflows to gather an overview
@@ -602,10 +603,8 @@ private String typeURIToString(String uri) {
602
603
* @throws IOException
603
604
*/
604
605
private JsonNode yamlPathToJson (Path path ) throws IOException {
605
- Yaml reader = new Yaml ();
606
+ Yaml reader = new Yaml (new SafeConstructor () );
606
607
ObjectMapper mapper = new ObjectMapper ();
607
- Path p ;
608
-
609
608
try (InputStream in = Files .newInputStream (path )) {
610
609
return mapper .valueToTree (reader .load (in ));
611
610
}
@@ -618,7 +617,7 @@ private JsonNode yamlPathToJson(Path path) throws IOException {
618
617
* @return A JsonNode with the content of the document
619
618
*/
620
619
private JsonNode yamlStreamToJson (InputStream yamlStream ) {
621
- Yaml reader = new Yaml ();
620
+ Yaml reader = new Yaml (new SafeConstructor () );
622
621
ObjectMapper mapper = new ObjectMapper ();
623
622
return mapper .valueToTree (reader .load (yamlStream ));
624
623
}
You can’t perform that action at this time.
0 commit comments