lumeohq / xsd-parser-rs

A xsd/wsdl => rust code generator written in rust
Apache License 2.0
98 stars 37 forks source link

Some example required #142

Open Smotrov opened 2 years ago

Smotrov commented 2 years ago

It would be really appreciated if you'll share some examples how it is actually possible to to generate RUST code using your parser. How to convert an XSD file to rust struct? Digging through source code but with no luck yet.

koolquark commented 2 years ago

Hi,

Here's an example on generating rust code form xsd file.

mkdir data_models
cd data_models
wget https://raw.githubusercontent.com/BroadbandForum/cwmp-data-models/master/cwmp-1-0.xsd   -O  cwmp-1-0.xsd
cd ..
mkdir gen_code
# clone the repo
cd xsd-parser-rs
cargo build
./target/debug/xsd-parser  -i ../data_models/cwmp-1-0.xsd   -o ../gen_code/cwmp_1_0.rs 
N8-I commented 11 months ago

Would be great to get that in the readme