From ea5b8bef64517be1ab2f1ebe7b0ec2104fecd95a Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 29 Aug 2023 10:19:59 +0200 Subject: [PATCH 1/2] fix error when a parameter is not present in the schema and evaluates to false --- CHANGELOG.md | 5 ++++- .../src/main/nextflow/validation/SchemaValidator.groovy | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb43548..bc9fde1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ # nextflow-io/nf-validation: Changelog -# Version 0.4.0 +## Version 0.4.0 (dev) + +### Bug fixes - 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)) +- Fix error when a parameter is not present in the schema and evaluates to false ([]()) ## Version 0.3.1 diff --git a/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy b/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy index b8e3f9a..5f10f0f 100644 --- a/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy +++ b/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy @@ -316,9 +316,9 @@ class SchemaValidator extends PluginExtensionPoint { def isCamelCaseBug = (specifiedParam.contains("-") && !expectedParams.contains(specifiedParam) && expectedParamsLowerCase.contains(specifiedParamLowerCase)) if (!expectedParams.contains(specifiedParam) && !params_ignore.contains(specifiedParam) && !isCamelCaseBug) { if (failUnrecognisedParams) { - errors << "* --${specifiedParam}: ${paramsJSON[specifiedParam]}".toString() + errors << "* --${specifiedParam}: ${params[specifiedParam]}".toString() } else { - warnings << "* --${specifiedParam}: ${paramsJSON[specifiedParam]}".toString() + warnings << "* --${specifiedParam}: ${params[specifiedParam]}".toString() } } } From 32573e3922629e80af48a8eee03d88ec351c2952 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 29 Aug 2023 10:22:52 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc9fde1..9055c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Bug fixes - 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)) -- Fix error when a parameter is not present in the schema and evaluates to false ([]()) +- Fix error when a parameter is not present in the schema and evaluates to false ([#89](https://github.com/nextflow-io/nf-validation/pull/89)) ## Version 0.3.1