common-workflow-lab/wdl-cwl-translator

re-do optional inputs default values

mr-c opened this issue · 0 comments

mr-c commented
1. What should the default value be? I think we had `null` as the default value first, but changed to `""` because we didn't want null to be passed into the command.

Yeah, that made sense at the beginning of this project. Now we see that we need a new approach, so it is time to improve it.

After reading https://github.com/openwdl/wdl/blob/main/versions/1.1/SPEC.md#concatenation-of-optional-values I think that we may need to re-do how we handle optional WDL inputs.

It seems the safer thing to do is

  1. Not define a default value for optional inputs (unless the WDL document has one)

and

  1. For each WDL expression placeholder ~{…} containing references to one or more optional inputs
    a. replace it with CWL expression that returns an empty string if any of the optional inputs referenced in the WDL expression are missing (=== null) and otherwise returns the result of the expression itself.

Originally posted by @mr-c in #78 (comment)