Skip to content

Commit

Permalink
Add support for ValidationError argument params
Browse files Browse the repository at this point in the history
This isn't part of released django-rest-framework, but has been merged upstream.

Upstream PR: encode/django-rest-framework#8863
  • Loading branch information
intgr committed Feb 6, 2023
1 parent 4fb7adf commit b56596d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rest_framework-stubs/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from collections.abc import Sequence
from typing import Any

from typing_extensions import TypeAlias

from django.http import HttpRequest, JsonResponse
from django_stubs_ext import StrOrPromise
from rest_framework.renderers import BaseRenderer
from rest_framework.request import Request
from typing_extensions import TypeAlias

def _get_error_details(data: Any, default_code: str | None = ...) -> Any: ...
def _get_codes(detail: Any) -> Any: ...
Expand All @@ -28,7 +27,12 @@ class APIException(Exception):
def get_codes(self) -> Any: ...
def get_full_details(self) -> Any: ...

class ValidationError(APIException): ...
class ValidationError(APIException):
default_params: Mapping[str, Any]
def __init__(
self, detail: _Detail | None = ..., code: str | None = ..., params: Mapping[str, Any] | None = ...
) -> None: ...

class ParseError(APIException): ...
class AuthenticationFailed(APIException): ...
class NotAuthenticated(APIException): ...
Expand Down

0 comments on commit b56596d

Please sign in to comment.