Skip to content

Commit

Permalink
Add missing deprecated decorators (#8877)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Feb 23, 2024
1 parent 9fc5e18 commit 16edb69
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pydantic/deprecated/class_validators.py
Expand Up @@ -7,7 +7,7 @@
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union, overload
from warnings import warn

from typing_extensions import Literal, Protocol, TypeAlias
from typing_extensions import Literal, Protocol, TypeAlias, deprecated

from .._internal import _decorators, _decorators_v1
from ..errors import PydanticUserError
Expand Down Expand Up @@ -79,6 +79,12 @@ def __call__(
DeprecationWarning = PydanticDeprecatedSince20


@deprecated(
'Pydantic V1 style `@validator` validators are deprecated.'
' You should migrate to Pydantic V2 style `@field_validator` validators,'
' see the migration guide for more details',
category=None,
)
def validator(
__field: str,
*fields: str,
Expand Down Expand Up @@ -198,6 +204,12 @@ def root_validator(
...


@deprecated(
'Pydantic V1 style `@root_validator` validators are deprecated.'
' You should migrate to Pydantic V2 style `@model_validator` validators,'
' see the migration guide for more details',
category=None,
)
def root_validator(
*__args,
pre: bool = False,
Expand Down

0 comments on commit 16edb69

Please sign in to comment.