@@ -28,7 +28,7 @@ def parse_dict(cls, d):
28
28
29
29
c = d ["class" ]
30
30
requirements = [
31
- InlineJavascriptReq , SchemaDefRequirement , SoftwareRequirement , InitialWorkDirRequirement ,
31
+ InlineJavascriptRequirement , SchemaDefRequirement , SoftwareRequirement , InitialWorkDirRequirement ,
32
32
SubworkflowFeatureRequirement , ScatterFeatureRequirement , MultipleInputFeatureRequirement ,
33
33
StepInputExpressionRequirement , DockerRequirement , EnvVarRequirement , ShellCommandRequirement ,
34
34
ResourceRequirement
@@ -41,7 +41,7 @@ def parse_dict(cls, d):
41
41
return None
42
42
43
43
44
- class InlineJavascriptReq (Requirement ):
44
+ class InlineJavascriptRequirement (Requirement ):
45
45
"""
46
46
Indicates that the workflow platform must support inline Javascript expressions.
47
47
If this requirement is not present, the workflow platform must not perform expression interpolatation.
@@ -102,7 +102,7 @@ class InputRecordField(Serializable):
102
102
"""
103
103
Documentation: https://www.commonwl.org/v1.0/Workflow.html#InputRecordField
104
104
"""
105
- def __init__ (self , name , input_type , doc = None , input_binding = None , label = None ):
105
+ def __init__ (self , name , type , doc = None , input_binding = None , label = None ):
106
106
"""
107
107
:param name:
108
108
:param input_type:
@@ -114,7 +114,7 @@ def __init__(self, name, input_type, doc=None, input_binding=None, label=None):
114
114
:param label:
115
115
"""
116
116
self .name = name
117
- self .type = parse_type (input_type , requires_type = True )
117
+ self .type = parse_type (type , requires_type = True )
118
118
self .doc = doc
119
119
self .inputBinding = input_binding
120
120
self .label = label
@@ -124,8 +124,16 @@ def get_dict(self):
124
124
d ["type" ] = get_type_dict (self .type )
125
125
return d
126
126
127
+ # def parse_dict(cls, d):
128
+ # d["input_type"] = "string"
129
+ # ret = super(SchemaDefRequirement.InputRecordSchema.InputRecordField, cls).parse_dict(d)
130
+ # ret.type =
131
+
132
+
133
+ # ignore_fields_on_parse = "type"
127
134
parse_types = {
128
- "fields" : [InputRecordField ]
135
+ "fields" : [InputRecordField ],
136
+ "inputBinding" : [CommandLineBinding ]
129
137
}
130
138
131
139
class InputEnumSchema (Serializable ):
@@ -183,11 +191,22 @@ def parse_dict(cls, d):
183
191
return None
184
192
return cls .parse_dict_generic (cls , d )
185
193
194
+ parse_types = {
195
+ # Defined below because we need to have declared the class before we can use it
196
+ }
197
+
186
198
parse_types = {
187
- "fields " : [InputRecordSchema , InputEnumSchema , InputArraySchema ]
199
+ "types " : [InputRecordSchema , InputEnumSchema , InputArraySchema ],
188
200
}
189
201
190
202
203
+ # declare this here, because inside the InputArraySchema we haven't fully defined the schemas
204
+ SchemaDefRequirement .InputArraySchema .parse_types = {
205
+ "items" : [SchemaDefRequirement .InputRecordSchema , SchemaDefRequirement .InputEnumSchema ,
206
+ SchemaDefRequirement .InputArraySchema , str ]
207
+ }
208
+
209
+
191
210
class SoftwareRequirement (Requirement ):
192
211
"""
193
212
A list of software packages that should be configured in the environment of the defined process.
@@ -214,7 +233,7 @@ def __init__(self, package, version=None, specs=None):
214
233
self .specs = specs
215
234
216
235
parse_types = {
217
- "package " : [SoftwarePackage ]
236
+ "packages " : [SoftwarePackage ]
218
237
}
219
238
220
239
0 commit comments