-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
add exclude to Config #660
Copy link
Copy link
Closed
Labels
feature requestfeedback wantedtopic-serializationHow Pydantic serializes data, often related to `model_dump`, etc.How Pydantic serializes data, often related to `model_dump`, etc.
Metadata
Metadata
Assignees
Labels
feature requestfeedback wantedtopic-serializationHow Pydantic serializes data, often related to `model_dump`, etc.How Pydantic serializes data, often related to `model_dump`, etc.
From a user perspective I would rather add an exclude in the Config metaclass instead of passing the dict in to .json(). One of my model's fields is a Callable and I would like to call .json() on it, however I need to instead pass a custom encoder to the .json() which still puts the responsibility on the caller.
Originally posted by @enkoder in #648 (comment)