schema_salad icon indicating copy to clipboard operation
schema_salad copied to clipboard

Add a possibility to specify default values for fields in schema salad

Open hmenager opened this issue 7 years ago • 2 comments

It would be interesting to be able to specify a default value for fields in schema_salad based specs. Currently they are mentioned in the documentation field, but this is not really machine readable (e.g. https://github.com/common-workflow-language/common-workflow-language/blob/master/v1.0/CommandLineTool.yml#L172). Having these would help a lot to generate SDKs ;) cc @anton-khodak @khillion

hmenager avatar Jul 21 '17 13:07 hmenager

  1. Add "default" field to Salad metaschema
  2. Add support to Python codegen to set value of "default" on fields which are not loaded from document
  3. Update CWL spec with machine-readable defaults

tetron avatar Jan 17 '18 21:01 tetron

2020-12-02 update:

  1. default was added to the schema-salad v1.1 spec: https://www.commonwl.org/v1.1/SchemaSalad.html#Introduction_to_v1.1
  2. No updates have been made to the Python codegen yet about defaults (nor the Java codegen)
  3. There are many defaults set in CWL v1.2, here's PR to add 4 more: https://github.com/common-workflow-language/cwl-v1.2/pull/68

mr-c avatar Dec 02 '20 09:12 mr-c