-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
good first issuehelp wantedPull Request welcomePull Request welcomenon-breaking-changeAddressing this issue does not require a breaking changeAddressing this issue does not require a breaking change
Description
Initial Checks
- I confirm that I'm using Pydantic V2
Description
When creating a generic RootModel without providing the generic to the model in the class inheritance RootModelRootType is mentioned in the error message, which is somewhat misleading.
I would expect RootModelRootType to be stripped from suggested types and maybe if possible to mention the needed parametrization of the RootModel itself
Example Code
from typing import Generic, TypeVar
from pydantic import BaseModel, RootModel
T_ = TypeVar("T_", bound=BaseModel)
class GenericRootModel(RootModel, Generic[T_]):
root: T_ | intPython, Pydantic & OS Version
pydantic version: 2.6.0
pydantic-core version: 2.16.1
pydantic-core build: profile=release pgo=true
install path: $HOME/pyjcsidm/.venv/lib/python3.11/site-packages/pydantic
python version: 3.11.6 (main, Oct 8 2023, 05:06:43) [GCC 13.2.0]
platform: Linux-6.2.0-26-generic-x86_64-with-glibc2.38
related packages: mypy-1.8.0 email-validator-2.1.0.post1 typing_extensions-4.9.0 pydantic-settings-2.1.0
commit: unknown
Metadata
Metadata
Assignees
Labels
good first issuehelp wantedPull Request welcomePull Request welcomenon-breaking-changeAddressing this issue does not require a breaking changeAddressing this issue does not require a breaking change