You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this deserialization fails, however, it manifests as an opaque 500 error to the client. We should capture deserialization errors and send a 400 with as much information as possible.
@gagandeepp This error can be replicated by passing any model that doesn't match the request model. Using the example: ballots = [PlaintextBallot.from_json_object(ballot) for ballot in request.ballots]
will fail if there is an issue with ballot object such as a missing field, a string passed instead of a number, etc.
Yes, it should be addressed at all sections where a model is parsed. Probably a wrapping method.
Activity
[-]Return `400` errors on deserialization failure[/-][+]Return 400 errors on deserialization failure[/+]gagandeepp commentedon Oct 3, 2021
Interested please assgn
keithrfung commentedon Oct 6, 2021
@gagandeepp you got it!
gagandeepp commentedon Oct 8, 2021
@rkorsak how to reproduce this error?
Also do we need to make changes for all the scenarios in this ticket?
keithrfung commentedon Oct 8, 2021
@gagandeepp This error can be replicated by passing any model that doesn't match the request model. Using the example:
ballots = [PlaintextBallot.from_json_object(ballot) for ballot in request.ballots]will fail if there is an issue with
ballotobject such as a missing field, a string passed instead of a number, etc.Yes, it should be addressed at all sections where a model is parsed. Probably a wrapping method.