The struggle is real. json.dumps won’t magically know how to serialize your custom class.
Quick fix: Add a `to_json()` method to your class that returns a dict. Then do `json.dumps(your_obj.to_json())`.
Or, if you’re feeling fancy, use `marshmallow` or `pydantic` for proper serialization. Overkill for debugging, though.
Quick fix: Add a `to_json()` method to your class that returns a dict. Then do `json.dumps(your_obj.to_json())`.
Or, if you’re feeling fancy, use `marshmallow` or `pydantic` for proper serialization. Overkill for debugging, though.
