Problemunvalidated
The `exclude_none` parameter to `model.model_dump` would apply to all entries of response, so it is not suitable. — Response is serialized/dumped as a JSON. Tension: I want attr2 to be included only if it is non-null. Importantly, `stuff1` should be included regardless of its type (null or int). Outcome: Pydantic v2 has custom serialization which allows one to control how objects are converted to JSON, but I am using 1.10.
5906773a-5f80-414c-9385-db478dda6f71
The exclude_none parameter to model.model_dump would apply to all entries of response, so it is not suitable. — Response is serialized/dumped as a JSON. Tension: I want attr2 to be included only if it is non-null. Importantly, stuff1 should be included regardless of its type (null or int). Outcome: Pydantic v2 has custom serialization which allows one to control how objects are converted to JSON, but I am using 1.10.