Closed omargawdat closed 1 week ago
hello again, i have tried extend_validation_errors but unfortunately I can't add more than one validation error as I was trying to add three while only invalid otp has appeared in swagger
@extend_validation_errors(["invalid_phone_country", "invalid_otp", "phone_number_user_mismatch"], field_name="__all__", methods=["post"])
{ "errors": [ { "attr": "non_field_errors", "code": "invalid", "detail": "string" }, { "attr": "phone_number", "code": "blank", "detail": "string" }, { "attr": "otp", "code": "blank", "detail": "string" }, { "attr": "__all__", "code": "invalid_otp", "detail": "string" } ] }
hello again, i have tried extend_validation_errors but unfortunately I can't add more than one validation error as I was trying to add three while only invalid otp has appeared in swagger
@extend_validation_errors(["invalid_phone_country", "invalid_otp", "phone_number_user_mismatch"], field_name="__all__", methods=["post"])
{ "errors": [ { "attr": "non_field_errors", "code": "invalid", "detail": "string" }, { "attr": "phone_number", "code": "blank", "detail": "string" }, { "attr": "otp", "code": "blank", "detail": "string" }, { "attr": "__all__", "code": "invalid_otp", "detail": "string" } ] }