Skip to content

Commit 519331d

Browse files
committed
include top level schemas when packing
1 parent e6dd92a commit 519331d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cwltool/pack.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ def rewrite_id(r, mainuri):
174174
namespaces = metadata.get('$namespaces', None)
175175

176176
schemas = set() # type: Set[Text]
177+
if '$schemas' in metadata:
178+
for each_schema in metadata["$schemas"]:
179+
schemas.add(each_schema)
177180
for r in sorted(runs):
178181
dcr, metadata = document_loader.resolve_ref(r)
179182
if isinstance(dcr, CommentedSeq):
@@ -208,7 +211,10 @@ def rewrite_id(r, mainuri):
208211
# duplicate 'cwlVersion' inside $graph when there is a single item
209212
# because we're printing contents inside '$graph' rather than whole dict
210213
packed["$graph"][0]["cwlVersion"] = packed["cwlVersion"]
211-
if namespaces:
212-
packed["$graph"][0]["$namespaces"] = dict(cast(Dict, namespaces))
214+
if namespaces:
215+
packed["$graph"][0]["$namespaces"] = dict(cast(Dict, namespaces))
216+
if schemas:
217+
packed["$graph"][0]["$schemas"] = list(schemas)
218+
213219

214220
return packed

0 commit comments

Comments
 (0)