Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fmigneault opened this issue Jun 6, 2023 · 0 comments

Comments

@fmigneault
Copy link
Contributor

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant