@@ -370,6 +370,11 @@ def cwl_to_jsonschema(cwl_obj: Union[Workflow, CommandLineTool]) -> Any:
370
370
371
371
# Traverse the properties and return all definitions that are used
372
372
def _recursive_search (json_data , target_key , result = None ):
373
+ """
374
+ Function for slim_definitions.
375
+
376
+ Given a target key return all instances of a key in a json object.
377
+ """
373
378
if result is None :
374
379
result = []
375
380
@@ -388,6 +393,11 @@ def _recursive_search(json_data, target_key, result=None):
388
393
389
394
# Get all the property dependencies
390
395
def _get_all_ref_attributes (json_object ):
396
+ """
397
+ Function get slim_definitions.
398
+
399
+ Given a json object, return all the reference attributes.
400
+ """
391
401
return _recursive_search (json_object , "$ref" )
392
402
393
403
@@ -396,6 +406,11 @@ def get_property_dependencies(
396
406
input_json_schema : Dict ,
397
407
existing_property_dependencies : List = None ,
398
408
) -> List [str ]:
409
+ """
410
+ Function for get slim_definitions.
411
+
412
+ Recursively collect all dependencies for a property (so we don't remove them from the schema).
413
+ """
399
414
# Initialise return list
400
415
if existing_property_dependencies is None :
401
416
existing_property_dependencies = []
@@ -485,7 +500,7 @@ def get_cwl_url(url: str) -> str:
485
500
return url
486
501
else :
487
502
# urlparse(url).scheme not in ['file']:
488
- response = requests .get (url )
503
+ response = requests .get (url , timeout = 20 )
489
504
if response .status_code != 200 :
490
505
logging .error ("The CWL URL is invalid." )
491
506
raise FileNotFoundError
0 commit comments