From 2c7b2c3e19dbd058f1d980ae5b890c29f02abb3d Mon Sep 17 00:00:00 2001 From: ThomasHickman Date: Fri, 18 Aug 2017 14:13:43 +0100 Subject: [PATCH] Improved array generation --- gatkcwlgenerator/gen_cwl_arg.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gatkcwlgenerator/gen_cwl_arg.py b/gatkcwlgenerator/gen_cwl_arg.py index d3777db..3aa12bc 100644 --- a/gatkcwlgenerator/gen_cwl_arg.py +++ b/gatkcwlgenerator/gen_cwl_arg.py @@ -170,11 +170,16 @@ def get_CWL_type(argument): # inputBinding prefixes and it works with object types # Also adding the type itself for convenience - this would be interpreted as # a one element array - typ = [typ, { + array_type = { "type": "array", "items": typ, "inputBinding": get_input_bindings(argument, typ == "File") - }] + } + + if isinstance(typ, list): + typ = typ + [array_type] + else: + typ = [typ, array_type] if argument['required'] == 'no': if isinstance(typ, list):