Enable Pydantic validation in DRF serializers
mainBy default, drf-pydantic only uses DRF's validation. To run your complex Pydantic validators (e.g., @field_validator) during the DRF .is_valid() call, set "validate_pydantic": True in the drf_config dictionary of your model.
from drf_pydantic import BaseModel
class MyModel(BaseModel):
name: str
addresses: list[str]
drf_config = {"validate_pydantic": True}
my_serializer = MyModel.drf_serializer(data={"name": "Van", "addresses": []})
my_serializer.is_valid() # This will also trigger Pydantic validation