sbg / sevenbridges-r

Seven Bridges API Client, CWL Schema, Meta Schema, and SDK Helper in R
https://sbg.github.io/sevenbridges-r/
Apache License 2.0
35 stars 14 forks source link

The 'required' field in CWL is not kept when convert app #61

Open tdelhomme opened 7 years ago

tdelhomme commented 7 years ago

Hi all,

When I want to convert a CWL JSON file into an app, my 'required' field is not taken into account:

The following is one of my input definition:

    {
      "sbg:category": "Basic",
      "type": "string",
      "description": "Name of the variant calling output file.",
      "label": "output VCF file name",
      "id": "#output_vcf_name",
      "required" : false,
      "inputBinding": {
        "separate": false,
        "sbg:cmdInclude": true,
        "position": 0,
        "prefix" : "--output=",
        "valueFrom" : {
          "class": "Expression",
          "script": " $job.inputs.bamfile.name + '_platypus.vcf' ",
          "engine": "#cwl-js-engine"
        }
      }
    }

and I get:

> platypus = convert_app(f)
> platypus$get_required()
        bamfile             ref output_vcf_name 
         "File"          "File"        "string" 
nanxstats commented 7 years ago

@tengfei and I are considering the possibility of a hotfix for this.

tengfei commented 7 years ago

@tdelhomme I think required field is only defined in Tool object in R, not a CWL field. the way CWL define required is using type, for example, please change "type": ["null", "string"]

this means its required

Sorry for the confusion, I need to fix this issue, so will leave it open.