xsd-parser-rs
xsd-parser-rs copied to clipboard
Unclear where to import xsd module from
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde()]
pub struct Example {
#[yaserde(attribute, rename = "Version")]
pub version: xsd::UnsignedInt,
#[yaserde(attribute, rename = "PlatformType")]
pub platform_type: xsd::String,
}
I assumed these are the correct imports:
use xsd_parser::generator::validator::Validate;
use xsd_types::types as xsd;
However, the generated are not in xsd_types. Where am I supposed to import xsd from? Thank you.
What was your input XSD?
Just guessing at your issue, if you had something like
<xsd:complexType name="Example">
<xsd:element name="version" type="xsd:UnsignedInt"/>
<xsd:element name="platform_type" type="xsd:String"/>
</xsd:complexType>
as opposed to using the built-in numeric types
<xsd:complexType name="Example">
<xsd:element name="version" type="xsd:unsignedInt"/>
<xsd:element name="platform_type" type="xsd:string"/>
</xsd:complexType>
then this would be the expected behaviour (I believe).