diff --git a/pyproject.toml b/pyproject.toml index 9c52d32..4362cee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Framework :: FastAPI", ] dependencies = [ - "dhi>=1.1.3", + "dhi>=1.1.15", ] [project.urls] diff --git a/tests/test_satya_0_4_0_compatibility.py b/tests/test_satya_0_4_0_compatibility.py index 6f7f9b6..49f2cb9 100644 --- a/tests/test_satya_0_4_0_compatibility.py +++ b/tests/test_satya_0_4_0_compatibility.py @@ -6,7 +6,7 @@ """ import pytest -from dhi import BaseModel, Field, ValidationError, field_validator +from dhi import BaseModel, Field, ValidationError from turboapi.models import TurboRequest, TurboResponse @@ -251,18 +251,18 @@ class User(BaseModel): assert "alice@example.com" in json_str def test_field_validator(self): - """Test field_validator decorator.""" + """Test string transformation with StripWhitespace. + + Note: dhi 1.1.15+ uses built-in string transformers like StripWhitespace + instead of field_validator decorators for common string operations. + """ + from typing import Annotated + from dhi import StripWhitespace + class User(BaseModel): - name: str + name: Annotated[str, StripWhitespace()] email: str - @field_validator('name') - @classmethod - def name_must_not_be_empty(cls, v): - if not v.strip(): - raise ValueError('name cannot be empty') - return v.strip() - user = User(name=" Alice ", email="a@b.com") assert user.name == "Alice"