diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5a1b1..cb43548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # nextflow-io/nf-validation: Changelog +# Version 0.4.0 + +- Add parameters defined on the top level of the schema and within the definitions section as expected params ([#79](https://github.com/nextflow-io/nf-validation/pull/79)) + ## Version 0.3.1 ### Bug fixes diff --git a/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy b/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy index acf90c9..b8e3f9a 100644 --- a/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy +++ b/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy @@ -281,6 +281,12 @@ class SchemaValidator extends PluginExtensionPoint { def enumsTuple = collectEnums(schemaParams) def List expectedParams = (List) enumsTuple[0] + addExpectedParams() def Map enums = (Map) enumsTuple[1] + // Collect expected parameters from the schema when parameters are specified outside of "definitions" + if (parsed.containsKey('properties')) { + def enumsTupleTopLevel = collectEnums(['top_level': ['properties': parsed.get('properties')]]) + expectedParams += (List) enumsTupleTopLevel[0] + enums += (Map) enumsTupleTopLevel[1] + } //=====================================================================// // Check if files or directories exist