People complain about this problem so much, even though deserializing data types should really be reserved for the boundaries of your system where communication with the outside world happens.
Despite that, I have still made a demo for this that works very simply using normal records functions.