CWL Schema is now available on JSON Schema Store

Hi all,

Excited to announce that the CWL JSON Schema is now available on the JSON Schema store!!

This means that any interaction with CWL on an IDE that supports JSON Schemas will syntax highlight your code and hopefully both autocomplete and error highlight any CWL code you may have.

2 Likes

VSCode Setup:

  1. Install the RedHat Yaml extension.
  2. Associate .cwl file types with .yaml
    This can be achieved by opening up user settings.json and adding the following code:
{
  "files.associations": {
      "*.cwl": "yaml"
  }
}

settings.json can be opened via the command pallete (Ctrl + Shift + P) and entering Preferences: Open User Settings (JSON)

JetBrains Setup

Make sure your .cwl files are associated as yaml files by going
Settings (Ctrl + Alt +S ) → Editor → File Types → YAML

Add *.cwl to the list of file name patterns

Example - Highlight Invalid Keys

Invalid key in input item (VSCode)

invalid_key_vscode_2

Invalid top level document key (VSCode)

invalid_key_vscode_1

Invalid key in argument item (JetBrains)

invalid_key_jetbrains_3

Invalid requirements key (JetBrains)

invalid_key_jetbrains_2

Invlid top level key (JetBrains)

invalid_key_jetbrains_1

Example - Hightlight Documentation

Show inputBinding documentation (VSCode)

show_doc_vscode_1

Show valueFrom documentation (JetBrains)

invalid_key_jetbrains_3

Show requirements documentation (JetBrains)

show_doc_jetbrains_1

Provide Valid Suggestions

Provide valid suggestion to input item (VSCode)
valid_suggestions_vscode_2

Provide valid suggestion to requirements (VSCode)
valid_suggestions_vscode_1

Provide valid suggestion to input (JetBrains)
valid_suggestions_jetbrains_2

Provide valid suggestion to requirements (JetBrains)
valid_suggestions_jetbrains_1

Note: Enabling VSCode extensions such as vscode-cwl or CWL (Rabix/Benten) may cause the JSON Schema highlighting not to work