lumeohq / xsd-parser-rs

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

How to use the project? #119

Closed lucaswxp closed 3 years ago

lucaswxp commented 3 years ago

Hey guys.

I was able to generate the rust code for my xsd, but I'm having a hard time compiling, I have the following problem with the YaSerialize/YaDeserialize derive:

no method named `serialize` found for struct `std::string::String` in the current scope

method not found in `std::string::String`rustc(E0599)

For the following code:

use yaserde_derive::{YaDeserialize, YaSerialize};

#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
#[yaserde()]
pub struct Header {
    #[yaserde(rename = "merchantId")]
    pub merchant_id: MerchantId,

    #[yaserde(rename = "merchantName")]
    pub merchant_name: MerchantName,

    #[yaserde(rename = "createdOn")]
    pub created_on: CreatedOn,
}

I guess I'm missing some import, but can't figure it out which.

jplatte commented 3 years ago

This seems like a bug. However, the example you provided does not use this crate at all. I'm a bit confused. Also #[yaserde()] seems pointless, what's the idea of that?

lucaswxp commented 3 years ago

@jplatte Hey there. So, the #[yarserde()] came with the auto-generated code, so I'm not sure...

I fixed the above issue by renaming all type-alias to a direct String type. I'm going to close this. But in case you have anything to add regarding yarsede feel free.

jplatte commented 3 years ago

Okay, after re-reading I understand better. I might try to reproduce your issue at some point, but if you've figured out a way to make it work for now, that's good 🙂