This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Reference implementation rejects step without inputs

I'm trying to build a workflow with a step that doesn't take any input:

The workflow fails to validate with this error:

/home/psafont/.virtualenvs/cwl/bin/cwl-runner 1.0.20161207161158
Resolved 'textures.cwl' to 'file:///home/psafont/dev/stellaris-emblem-lab/textures/scripts/textures.cwl'
Tool definition failed validation:
Validation error in object file:///home/psafont/dev/stellaris-emblem-lab/textures/scripts/textures.cwl
  Could not validate `Workflow` because
    Workflow record could not validate field `steps` because
      the value `[{'id': u'file:///home/psafont/dev/stellaris-emblem-lab/textures/scripts/textures.cwl#gradients',
        'out': [u'file:///home/psafont/dev/stellaris-emblem-lab/text[...]`
       is not a valid type in the union, expected one of:
      - array of <WorkflowStep>, but
         At position 0
          missing required field `in`

This is the workflow:

cwlVersion: v1.0
doc: Create emblem textures
class: Workflow

inputs:
  outlines: File[]
outputs:
  texture_small:
    type: File
    outputSource: textures/small
    outputBinding:
      outputEval: texture/$(inputs.outline.nameroot).dds

steps:
  gradients:
    id: gradients
    run: tools/gradients_gen.cwl
    out: [fill_gradient, highlight_gradient]

  textures:
    id: textures
    run: texture_emblem.cwl
    requirements: ScatterfeatureRequirement
    scatter: outline
    in:
      outline: outlines
      fill_gradient: gradients/fill_gradient
      highlight_gradient: gradients/highlight_gradient
    out: [small]

I'd like to know if the 'in' parameter is not-so-optional or there's something else I'm missing.

Note: I'm sure there are other mistakes in the workflow, but this is the error I'm encountering right now :)

common-workflow-language cwl

1 answer

You need to provide an "in" section with an empty list. Also "id: gradients" is redundant:

gradients:
    run: tools/gradients_gen.cwl
    in: []
    out: [fill_gradient, highlight_gradient]

However you're right, as a general rule, fields which can accept empty lists should be optional.

That's odd, there is an error with the website generation; that field is indeed required in v1.0. [Peter, looks like a bad version of schema salad?]

The website has been fixed -- thank you for bringing that to our attention. I agree with Peter that fields which can accept empty lists should be optional.

Log in to answer this question.