You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validation should raise an error due to the minimum length constraint set for the data field in the Test model. However, no validation error is raised even though the data field is empty.
Expected Behavior:
Passing empty data for the data field should raise a validation error due to the minimum length constraint set in the Test model.
Actual Behavior:
No validation error is raised when passing empty data for the data field.
Steps to Reproduce:
Define the provided models in a Pydantic-based Python script.
Attempt to validate input data where the data field is empty.
Notice that no validation error is raised even though the data field does not meet the minimum length constraint.
Additional Information:
This behavior was observed in Pydantic version 2.6.4.
Example Code
frompydanticimportBase64Bytes, BaseModel, FieldclassTest(BaseModel):
data: Base64Bytes=Field(min_length=10)
test=Test(data=b"") # no validation error
Initial Checks
Description
The validation should raise an error due to the minimum length constraint set for the
data
field in theTest
model. However, no validation error is raised even though thedata
field is empty.Expected Behavior:
Passing empty data for the
data
field should raise a validation error due to the minimum length constraint set in theTest
model.Actual Behavior:
No validation error is raised when passing empty data for the
data
field.Steps to Reproduce:
Define the provided models in a Pydantic-based Python script.
Attempt to validate input data where the
data
field is empty.Notice that no validation error is raised even though the
data
field does not meet the minimum length constraint.Additional Information:
This behavior was observed in Pydantic version
2.6.4
.Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: