StrictBytes
does not raise ValidationError
when max_length
is present in Field
#4380
Closed
6 of 16 tasks
Labels
bug V1
Bug related to Pydantic V1.X
Initial Checks
Description
I'm using pydantic version 1.9.2.
Mind this model:
Even though
b
isStrictBytes
, I can create an object with the following line:m = Model(a=b'arthur', b=123)
which I assume is a bug.I cannot create an object the other way around:
m = Model(a=123, b=b'art')
, which I assume is the intended behaviour.Here follows a pytest example:
And the output from pytest:
Example Code
Python, Pydantic & OS Version
Affected Components
.dict()
and.json()
construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: