lumeohq / xsd-parser-rs

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

Find a way to serialize tuple structs with yaserde #15

Closed victor-soloviev closed 4 years ago

victor-soloviev commented 4 years ago

For following xsd

<xs:simpleType name="Name">
  <xs:restriction base="xs:string">
    <xs:maxLength value="64"/>
  </xs:restriction>
</xs:simpleType>

we are generating following struct

#[derive(Default, PartialEq, Debug)]
pub struct Name (String);

Turns out that YaSerialize could not be derived for structs with nameless fields (tupple structs), nor it could be used for structs containing such tupple structs.

We need to implement YaSerialize and YaDeserialize traits for structs with nameless fields.

Associated issue in yaserde repo: https://github.com/media-io/yaserde/issues/25