Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

add parameters from schema top level as expected params #79

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down