Skip to content

Commit

Permalink
Override dataclass_transform behavior for RootModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Nov 18, 2023
1 parent 24272b4 commit ee730aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pydantic/root_model.py
Expand Up @@ -6,9 +6,11 @@
from copy import copy, deepcopy

from pydantic_core import PydanticUndefined
from typing_extensions import dataclass_transform

from . import PydanticUserError
from ._internal import _repr
from .fields import Field as PydanticModelField
from .main import BaseModel, _object_setattr

if typing.TYPE_CHECKING:
Expand All @@ -25,6 +27,7 @@
RootModelRootType = typing.TypeVar('RootModelRootType')


@dataclass_transform(kw_only_default=False, field_specifiers=(PydanticModelField,))
class RootModel(BaseModel, typing.Generic[RootModelRootType]):
"""Usage docs: https://docs.pydantic.dev/2.6/concepts/models/#rootmodel-and-custom-root-types
Expand Down

0 comments on commit ee730aa

Please sign in to comment.