This tool does 2 things:
- Converts XML Schema files (.xsd) to Protocol Buffers (.proto).
- Modifies existing proto files by adding, modifying and removing fields, messages etc. Also support for merging proto files using the same package
Standalone (Only for converting XSD to PROTO)
See standalone tool
Maven (Both converting XSD to PROTO and for modifying PROTO files
See maven plugin
Maintaining backwards compatibility
If your use case is to maintain a proto descriptor based on a "living" xsd, you will need to detect and possibly resolve any backwards incompatibility issues that may arise from modifying the xsd.
You can use the tool protolock to verify that i.e. fields have not changed name or id.
If you are using the Maven there is a plugin as well: https://github.com/salesforce/proto-backwards-compat-maven-plugin
Only automatic resolving of field name/id conflicts have been implemented so far.
See code style CODESTYLE.md
The schema2proto-wire module is a modified copy from https://github.com/square/wire/tree/master/wire-schema that seems to have become https://github.com/square/wire/tree/master/wire-library/wire-schema now.
The schema2proto-xsom module is a modified copy from https://github.com/eclipse-ee4j/jaxb-ri/tree/master/jaxb-ri/xsom, see original LICENSE
The codebase was once based on https://github.com/tranchis/xsd2thrift but has been completely rewritten.