Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed May 1, 2024
1 parent 8b9bd60 commit 595ea4b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions WDL/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,15 @@ def runner_input_value(s_value, ty, downloadable, root):
ty.item_type, [runner_input_value(s_value, ty.item_type, downloadable, root)]
)
if isinstance(ty, (Type.Pair, Type.Map, Type.StructInstance)):
# allow structs as JSON
return Value.from_json(ty, json.loads(s_value))
# parse JSON for compound types
try:
return Value.from_json(ty, json.loads(s_value))
except json.JSONDecodeError as exn:
raise Error.InputError(
"Invalid JSON for input of type {}, check syntax and shell quoting: {}".format(
str(ty), exn
)
)
if isinstance(ty, Type.Any):
# infer dynamically-typed runtime overrides
try:
Expand Down

0 comments on commit 595ea4b

Please sign in to comment.