ghazi-git / drf-standardized-errors

Standardize your DRF API error responses
https://drf-standardized-errors.readthedocs.io/en/latest/
MIT License
251 stars 15 forks source link

extend_validation_errors can't add many errors types #90

Closed omargawdat closed 1 week ago

omargawdat commented 2 weeks 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" } ] }