[FEATURE INCUBATOR] Add shorthand notations for required
and multiple
#735
Labels
enhancement
New feature or request
required
and multiple
#735
Feature summary
While looking at a simple CWL workflow I found it quite interesting that CWL has a different way of specifying input/output types.
Example Viash:
CWL:
Feature description
I'd like to pitch adding
type: file[]
,type: file?
andtype: file[]?
as sugar syntax for:file[]
:{type: file, multiple: true, required: true}
file?
:{type: file, multiple: false, required: false}
file[]?
:{type: file, multiple: true, required: false}
file
:{type: file, multiple: false, required: true}
Ohno. This is a breaking change! (because right now the default value for
required
isfalse
):(
If we don't want to make it a breaking change, we could consider:
file
:{type: file, multiple: false, required: false}
file[]
:{type: file, multiple: true, required: false}
file!
:{type: file, multiple: false, required: true}
file[]!
:{type: file, multiple: true, required: true}
Though I really don't like this notation since it's not a commonly used/understood notation/syntax
Why is this feature beneficial?
To me, it feels like a much easier way to show what the data type of the
par
object will be inside the script. It makes it easier to talk about an argument, because now in conversations I will sometimes talk about "an optional multiple file argument", but "a file[]? argument" would be easier.Hendrik mentioned that he had some concerns introducing unnecessary sugar syntax, which I totally understand.
Alternatives considered
No response
Possible solution
No response
Confirmation
The text was updated successfully, but these errors were encountered: