I have an older variant on this hacked together as a weekend project.
https://github.com/CharlieDigital/js2c
Takes an input snippet of JSON and builds up classes as serialization targets.