Skip to content

Commit deba6c8

Browse files
committed
fixed issue with job_id payload causing errors
1 parent 28495fe commit deba6c8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

app_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@ def decorator(f):
3030
def decorated_function(*args, **kwargs):
3131
if not request.json:
3232
return jsonify({"message": "Missing JSON in request"}), 400
33+
34+
# Create a copy of the request data and remove internal _cloud_job_id field
35+
# to prevent validation errors while preserving it for cloud job processing
36+
validation_data = request.json.copy()
37+
validation_data.pop('_cloud_job_id', None)
38+
3339
try:
34-
jsonschema.validate(instance=request.json, schema=schema)
40+
jsonschema.validate(instance=validation_data, schema=schema)
3541
except jsonschema.exceptions.ValidationError as validation_error:
3642
return jsonify({"message": f"Invalid payload: {validation_error.message}"}), 400
37-
43+
3844
return f(*args, **kwargs)
3945
return decorated_function
4046
return decorator

0 commit comments

Comments
 (0)