Skip to content

Commit 949dafb

Browse files
committed
fix(yaml): fixes issue with unclear error for filepath of empty string. Allows YAML files larger than 3MB as input - previously errored
1 parent caee8be commit 949dafb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/groovy/nextflow/validation/utils/Files.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package nextflow.validation.utils
22

33
import org.yaml.snakeyaml.Yaml
4+
import org.yaml.snakeyaml.LoaderOptions
45
import org.json.JSONArray
56
import org.json.JSONObject
67
import org.json.JSONPointer
@@ -85,7 +86,9 @@ public class Files {
8586
}
8687

8788
if(fileType == "yaml"){
88-
return new Yaml().load((file.text))
89+
def LoaderOptions yamlLoaderOptions = new LoaderOptions()
90+
yamlLoaderOptions.setCodePointLimit(50 * 1024 * 1024)
91+
return new Yaml(yamlLoaderOptions).load((file.text))
8992
}
9093
else if(fileType == "json"){
9194
return new JsonSlurper().parseText(file.text)

src/main/groovy/nextflow/validation/validators/evaluators/ExistsEvaluator.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class ExistsEvaluator implements Evaluator {
3030
}
3131

3232
def String value = node.asString()
33-
def Path file = Nextflow.file(value) as Path
3433
def Boolean exists
34+
def Path file
3535

3636
try {
3737
file = Nextflow.file(value) as Path

0 commit comments

Comments
 (0)