Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear where to import xsd module from #146

Open
torkleyy opened this issue Aug 16, 2023 · 1 comment
Open

Unclear where to import xsd module from #146

torkleyy opened this issue Aug 16, 2023 · 1 comment

Comments

@torkleyy
Copy link

#[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.

@lkirkwood
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants