diff --git a/src/curies/api.py b/src/curies/api.py index 7e8e024..053f6e1 100644 --- a/src/curies/api.py +++ b/src/curies/api.py @@ -36,7 +36,10 @@ from pydantic import BaseModel, Field from pytrie import StringTrie -from ._pydantic_compat import field_validator, get_field_validator_values +from ._pydantic_compat import PYDANTIC_V1, field_validator, get_field_validator_values + +if not PYDANTIC_V1: + from pydantic import ConfigDict if TYPE_CHECKING: # pragma: no cover import pandas @@ -201,10 +204,15 @@ class notion of parsed reference (instead of merely stringified ..., description="The local unique identifier used in a compact URI (CURIE)." ) - class Config: - """Pydantic configuration for references.""" + if PYDANTIC_V1: + + class Config: + """Pydantic configuration for references.""" - frozen = True + frozen = True + + else: + model_config = ConfigDict(frozen=True) @property def curie(self) -> str: