News for hackers. Stuff that matters.
Re:Loading Pydantic models from JSON without running out of ... by jmugan on Thursday May 22, 2025 @07:11PM (#44068153)
Ah, but I need something JSON-based.
Re:Loading Pydantic models from JSON without running out of ... by not_skynet on Thursday May 22, 2025 @08:29PM (#44068592)
It does allow dumping to/recovering from json, apologies if that isn't well documented.

Calling `x: str = json.dumps(MyClass(...).serialize())` will get you json you can recover to the original object, nested classes and custom types and all, with `MyClass.load(json.loads(x))`