Skip to content

Commit

Permalink
feat: added validation for mode parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed Jun 12, 2023
1 parent 6ff9144 commit dcf8c2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions biothings/management/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,14 @@ def do_dump_and_upload(plugin_name, logger=None):


def process_inspect(source_name, mode, limit, merge, logger, do_validate, output=None):
VALID_INSPECT_MODES = ["jsonschema", "type", "mapping", "stats"]
mode = mode.split(",")
if "jsonschema" in mode:
mode = ["jsonschema", "type"]
for m in mode:
if m not in VALID_INSPECT_MODES:
logger.error('"%s" is not a valid inspect mode', m)
raise typer.Exit(1)
if not limit:
limit = None
sample = None
Expand Down

0 comments on commit dcf8c2d

Please sign in to comment.