Open franklinvp opened 2 weeks ago
I think that what #828 is asking (traceback information) has a similar purpose. Although, there it is for serialization errors.
By the way, I was able to find the value and field causing the warning by building pydantic-core with the following modification to the error message
- "Expected `{field_type}` but got `{type_name}` - serialized value may not be as expected"
+ "Expected `{field_type}` but got `{type_name}` value: `{value}` - serialized value may not be as expected"
Would it be possible to make this warning more specific by mentioning either the value or perhaps the field that caused it?
I am calling
request.model_dump_json(indent=2)
and gettingbut there so many
enum.Enum
in therequest
that is hard to find which is causing the warning.The place where the warning message is composed seems[^1] to know the value.
[^1]: I am not sure, since I am not familiar with Rust.