Ask HN: Tools to declare typed structs across languages
3 comments
https://developers.google.com/protocol-buffers Is boring but works.
Is json a hard requirement?
https://capnproto.org/otherlang.html allows for a serialization free solution.
https://capnproto.org/otherlang.html 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.
1. Declare the schema of many data types
2. Use the schema to generate structs from those data types in multiple languages (Golang, Typescript, Dart)
3. Easily serialize and deserialize those types to and from JSON
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.
Any boring solutions out there?