How can I set default values for cwl files?
Here is my test.cwl
file
cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
inputs:
example_flag:
type: boolean
default: true
inputBinding:
position: 1
prefix: -f
example_string:
type: string
default: "abc"
inputBinding:
position: 3
prefix: --example-string
example_int:
type: int
default: 5
inputBinding:
position: 2
prefix: -i
separate: false
example_file:
type: File?
inputBinding:
prefix: --file=
separate: false
position: 4
outputs: []
With
$ dockstore tool convert cwl2json --cwl test.cwl
I get the following output
{
"example_string": "fill me in",
"example_file": {
"path": "fill me in",
"class": "File"
},
"example_flag": false,
"example_int": 0
}
Where are the default values I set in the test.cwl
file?
Bug posted: https://github.com/ga4gh/dockstore/issues/484
Issue closed on Nov 23, 2016
few languages and frameworks which I have used have support for writing YAML out of the box, thus leading to the constant requirements for including YAML library dependencies in your software stack. On the other hand, I have yet to find a language or framework where JSON is not included by default. Additionally, the indentation-heavy nature of YAML actually impairs readability greatly, because its nearly impossible to understand the structure of an object with nested attributes in YAML just by looking at it, the difference between 4, 6, 8, 12, etc., whitespaces becomes impossible to distinguish by eye. I think we really need to be encouraging JSON everywhere. YAML just makes everything worse in the long run.