JSON dumping a dictionary where some values are PyDantic models
Assume a dictionary with an arbitrary structure, where some values are native Python objects and others are instances of PyDantic's BaseModel subclasses e.g. my_dict = {"key1": "value1", "key2": {"key3": pydantic_object1, "key4": 4}, "key5": pydantic_object2} I want to dump this dictionary…