def validate_upload_manifest(): content_type = flask.request.headers.get('Content-Type', '').lower() if content_type == 'application/json': manifest_doc = parse.parse_request_json() else: manifest_doc = parse.parse_request_yaml() errors = manifest.validate_upload_manifest(manifest_doc) if errors: return flask.jsonify({"valid": False, "errors": errors}) else: return flask.jsonify({"valid": True})
def validate_upload_manifest(): """ Generate a list of errors found in JSON Schema validation. Summary: Validate a manifest of data files Tags: file Responses: 200 (schema_error_list): Success. """ content_type = flask.request.headers.get("Content-Type", "").lower() if content_type == "application/json": manifest_doc = parse.parse_request_json() else: manifest_doc = parse.parse_request_yaml() errors = manifest.validate_upload_manifest(manifest_doc) if errors: return flask.jsonify({"valid": False, "errors": errors}) else: return flask.jsonify({"valid": True})