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
I am having issues with some JSON Schema validator because of what I think is a subtle difference here - yes, we're setting x to be const=0, but we're not saying that the default is also zero, which leaves the field as not filled if one creates a default object. I don't think this is correct behaviour. I suggest deleting https://github.com/samuelcolvin/pydantic/blob/8997cc5961139dd2695761a33c06a66adbf1430a/pydantic/schema.py#L215 , which should fix the problem.
The text was updated successfully, but these errors were encountered:
PR welcome, but you'll need to see if it breaks other tests and go back to where we originally added that line and see if there's a reason we did it that way.
Checks
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:When running this snippet of code:
this is the result:
I am having issues with some JSON Schema validator because of what I think is a subtle difference here - yes, we're setting
x
to beconst=0
, but we're not saying that the default is also zero, which leaves the field as not filled if one creates a default object. I don't think this is correct behaviour. I suggest deleting https://github.com/samuelcolvin/pydantic/blob/8997cc5961139dd2695761a33c06a66adbf1430a/pydantic/schema.py#L215 , which should fix the problem.The text was updated successfully, but these errors were encountered: