This is a test version of Biostars. For the public version, visit https://www.biostars.org.
CWL: Make Enum optional (CommandInputEnumSchema)

Is it possible to make an Enum optional?

  outfmt:
      type:
          type: enum
          symbols:
            - clustal
            - clustal_num
            - fa
            - msf
            - nexus
            - phylip
            - selex
            - stockholm
            - vienna
          inputBinding:
            position: 13
            prefix: --outfmt

I have tried enum? but then it is not recognised as CommandInputEnumSchema.

cwl

? is just a shorthand for [ <T>, "null"]. Try the latter.

Could you provide an example? I have tried a few alternatives with null but I couldn't make it work.

1 answer

type:
  - "null"
  - type: array
    items:
      type: enum
      symbols: [none, apply, calculate]

Yes, as you found, it is easier when we give names to our custom types

Awesome! Thank you very much!

Log in to answer this question.