common-workflow-language / common-workflow-language/cwltool
ExpressionTools can return 'null' for type Any, but not CommandLineTools using cwl.output.json
- Dominant language
- Python
- Stars
- 376
- Forks
- 255
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 12
Description
## Expected Behavior
```
$ cwltool v1.0/null-expression3-tool.cwl
Error validating output record. the `output` field is not valid because
'Any' type must be non-null
in {
"output": null
}
```
## Actual Behavior
```
$ cwltool v1.0/null-expression3-tool.cwl
{
"output": null
}
INFO Final process status is success
```
## Workflow Code
The ExpressionTool: https://github.com/common-workflow-language/common-workflow-language/blob/6a955874ade22080b8ef962b4e0d6e408112c1ef/v1.0/v1.0/null-expression2-tool.cwl
and the equivalent CommandLineTool
``` cwl
#!/usr/bin/env cwl-runner
class: CommandLineTool
inputs: []
outputs:
- id: output
type: Any
requirements:
- class: InitialWorkDirRequirement
listing:
- entryname: expression.js
entry: |-
"use strict";
var inputs=$(inputs);
var runtime=$(runtime);
var ret = function(){return {'output': null };}();
process.stdout.write(JSON.stringify(ret));
hints:
- class: DockerRequirement
dockerPull: node:slim
- class: SoftwareRequirement
packages:
- package: nodejs
cwlVersion: v1.0
baseCommand:
- nodejs
- expression.js
stdout: cwl.output.json
```
```
## Your Environment
* cwltool version: 3.0.20201113073442
Contributor guide
Assessment
This issue has not been assessed yet.