Skip to content

XSD to proto descriptor conversion tool capable of manipulating proto files as well

License

Notifications You must be signed in to change notification settings

entur/schema2proto

Repository files navigation

schema2proto CircleCI

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

Artifacts

Artifacts are pushed to maven central: https://search.maven.org/search?q=schema2proto

Usage

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.

Contribution

See code style CODESTYLE.md

Licensing

EUPL, see LICENSE and https://en.wikipedia.org/wiki/European_Union_Public_Licence

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.

About

XSD to proto descriptor conversion tool capable of manipulating proto files as well

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages