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

Commit

Permalink
Merge pull request #76 from mirpedrol/file-validation-if-false
Browse files Browse the repository at this point in the history
Don't validate a file if the parameter evaluates to false
  • Loading branch information
mirpedrol authored Jul 12, 2023
2 parents 4fdbb3c + ee818b7 commit ef90632
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bug fixes

- Don't check if path exists if param is not true ([#74](https://github.com/nextflow-io/nf-validation/pull/74))
- Don't validate a file if the parameter evaluates to false ([#75](https://github.com/nextflow-io/nf-validation/pull/75))

## Version 0.3.0

Expand Down
4 changes: 4 additions & 0 deletions docs/nextflow_schema/nextflow_schema_specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ These schema files are typically stored in the pipeline `assets` directory, but
}
```

!!! note

If the parameter is set to `null`, `false` or an empty string, this validation is ignored. The file won't be validated.

## Numeric-specific keys

### `minimum`, `maximum`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class SchemaValidator extends PluginExtensionPoint {
def Map properties = (Map) group.value['properties']
for (p in properties) {
def String key = (String) p.key
if (params[key] == null || params[key] == '') {
if (!params[key]) {
continue
}
def Map property = properties[key] as Map
Expand Down

0 comments on commit ef90632

Please sign in to comment.