entur / schema2proto

XSD to proto descriptor conversion tool capable of manipulating proto files as well
European Union Public License 1.2
39 stars 20 forks source link

Converting an .xsd file that uses a type from another .xsd file? #569

Open andrew-otiv opened 3 months ago

andrew-otiv commented 3 months ago

I have xsd files that use types defined in other xsd files, and I would like to generate (also inter-dependent) proto files for them.

schema2proto only takes a single xsd file on the command line.

I hit an undefined type error for the types that are defined outside the xsd file that was passed to schema2proto: "[main] ERROR no.entur.schema2proto.generateproto.SchemaParser - undefined simple or complex type ..."

I verified using strace that schema2proto isn't attempting to load the other xsd files that contain the required types.

I tried setting --customImportLocations and --customImports, but that didn't change the xsd schema parsing behavior.

Is schema2proto capable of converting xsd files that depend on types defined in other .xsd files, and if so, how do I configure schema2proto to find the relevant files?

Thanks!