Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wirespecter committed Aug 23, 2024
1 parent fb47877 commit cef6971
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions reana_server/rest/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -3302,12 +3302,31 @@ def workflow_validation():
application/json:
message: OK
status: 200
400:
description: >-
Validation failed due to an error.
schema:
type: object
properties:
message:
type: string
status:
type: string
examples:
application/json:
message: Invalid REANA specification: None is not of type 'object'
status: 400
"""
reana_yaml = request.json
logging.info("test")
logging.info(reana_yaml)

validation_warnings = validate_reana_yaml(reana_yaml)
try:
validation_warnings = validate_reana_yaml(reana_yaml)
except Exception as e:
logging.info("sent error:")
logging.info(str(e))
return jsonify(message=str(e), status="400"), 400

"""Validate REANA specification file."""
if "options" in reana_yaml.get("inputs", {}):
Expand All @@ -3325,7 +3344,7 @@ def workflow_validation():
except REANAValidationError as e:
return jsonify(message=e.message, status="400"), 400

response = { "warnings": validation_warnings, "reana_spec_params": vars(reana_spec_params)["reana_params_warnings"]}
response = { "warnings": validation_warnings, "reana_spec_params": json.dumps(vars(reana_spec_params), default=list)}

logging.info("Response:")
logging.info(response)
Expand Down

0 comments on commit cef6971

Please sign in to comment.