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
But data, errors = user_schema.load(data=json_data) will ever issue execptions.
I changed with: from marshmallow import ValidationError
to:
try:
data = user_schema.load(data=json_data)
except ValidationError as errors:
return {'message': 'Validation errors', 'errors': errors.messages}, HTTPStatus.BAD_REQUEST
Now its working very well.
The text was updated successfully, but these errors were encountered:
In Class \Ressources\User.py you wrote this Code:
class UserListResource(Resource):
def post(self):
But data, errors = user_schema.load(data=json_data) will ever issue execptions.
I changed with: from marshmallow import ValidationError
to:
try:
data = user_schema.load(data=json_data)
except ValidationError as errors:
return {'message': 'Validation errors', 'errors': errors.messages}, HTTPStatus.BAD_REQUEST
Now its working very well.
The text was updated successfully, but these errors were encountered: