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 haven't checked, but I'm assuming the exclude keyword argument to Field is also affected. As far as I can tell, this seems to be the primary purpose of the include/exclude arguments (now that Config.fields is gone), so it may be worth removing them if we don't plan to fix this.
The text was updated successfully, but these errors were encountered:
And I can confirm that exclude is also affected as it can be seeing in the other issue.
This not only affects the model_dump_json but also model_json_schema
I think this needs to be fixed and not removed from the library, since pretty much all the types I have work with pydantic I had to exclude some attributes out (either from the public schema or from the output dict).
Also notice that if the field is mark as private (e.x _inner) in order to exclude it, with callable attribute it adds self as first argument, which makes the function fail since the first expected argument would be always self.
The following code has different behavior in v1 and v2:
I haven't checked, but I'm assuming the
exclude
keyword argument toField
is also affected. As far as I can tell, this seems to be the primary purpose of theinclude
/exclude
arguments (now thatConfig.fields
is gone), so it may be worth removing them if we don't plan to fix this.The text was updated successfully, but these errors were encountered: