RunUO has an implementation of this and it's like 25 years old but still worked really well
The serialization system I am providing here actually leverages System.Text.Json for reading and writing data — it's more concerned with helping you represent version-able, upgrade-able data models that are also compatible with the hierarchical state machine implementation I use for managing game state.
https://github.com/runuo/runuo/blob/master/Server/Serializat...