mibes404 / zeep

XSD/WSDL client code generator for Rust
MIT License
41 stars 18 forks source link

Generated code uses `flatten` on i32, though not supported on `yaserde` #9

Open jhartzell42 opened 2 years ago

jhartzell42 commented 2 years ago

zeep generated this:

            #[derive(Debug, Default, YaSerialize, YaDeserialize, Clone)]
#[yaserde(
    rename = "portNumber",
    namespace = "tns: urn:rpm-stateManagementInterface",
    prefix = "tns",
)]
pub struct PortNumber {
    #[yaserde(flatten, default)]
    pub body: i32, 
}

Which resulted in this error:

   --> src/soap.rs:148:51
    |
148 |             #[derive(Debug, Default, YaSerialize, YaDeserialize, Clone)]
    |                                                   ^^^^^^^^^^^^^
    |
    = help: message: not implemented: "flatten" is not implemented for FieldI32
mibes404 commented 2 years ago

Can you share the xsd (chunk) that leads to this code? Hard to determine a cause otherwise.

mibes404 commented 2 years ago

This seem to be something that has changed between yaserde versions. A modification was included in the yaserde_08 branch to skip flatten for primitive types. The change should make the code compile with yaserde 0.8.