Skip to content

Improve documentation of simplified [] and ? types for advanced use cases #254

@fmigneault

Description

@fmigneault

In https://www.commonwl.org/v1.2/CommandLineTool.html#Document_preprocessing

2.4 Document preprocessing

Another transformation defined in Schema salad is simplification of data type definitions. Type ending with ? should be transformed to [, "null"]. Type ending with [] should be transformed to {"type": "array", "items": }

There is no explicit mention of combining the two simplified type definitions.
This leaves room for interpretation.

For example: string[]?
Should this be understood as:

  1. required array of optional strings, ie:
type: array
items: [string, 'null']
  1. optional array of required strings. ie:
type: 
  - type: 'null'
  - type: array
    items: string
  1. both are optional, ie:
type: 
  - type: 'null'
  - type: array
    items: [string, 'null']
  1. neither (ie: disallowed to combine these shortcuts - I don't think so, because I've used them, but docs should mention it)
  2. Can the reverse be applied (ie: string?[])
    • Does it have the same meaning?
    • Is the order of ?/[] relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions