working example of a de/serializing a dynamically generated case class