Hi HN, Can someone help point me in the right direction? I'm looking for a tool to simplify the code generation of typed structs across platforms. This (boring) tool would allow me to:<p>1. Declare the schema of many data types<p>2. Use the schema to generate structs from those data types in multiple languages (Golang, Typescript, Dart)<p>3. Easily serialize and deserialize those types to and from JSON<p>My Google-fu seems to be pretty awful because I cannot find a single tool that allows me to declare a type schema without it also being an alternative to JSON.<p>Any boring solutions out there?
<a href="https://developers.google.com/protocol-buffers" rel="nofollow">https://developers.google.com/protocol-buffers</a> Is boring but works.
Is json a hard requirement?<p><a href="https://capnproto.org/otherlang.html" rel="nofollow">https://capnproto.org/otherlang.html</a> allows for a serialization free solution.
XML is old-school, but it works. Any program that processes the XML schema can validate them using XSD files. Repetition can be avoided using extensions like xpath and xinclude.