-
Notifications
You must be signed in to change notification settings - Fork 65
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
Prefix sometimes not working while deserializing #202
Comments
Can you test with a valid struct ? #[derive(YaSerialize, YaDeserialize, Debug, Default, Clone, Eq, PartialEq)]
#[yaserde(
namespaces = {
"urn" = "http://example.com/",
}
)]
struct Body {
#[yaserde(prefix = "urn")]
text: String,
} |
Good day.. im not sure what you mean by valid struct.. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:something" >
<soapenv:Header/>
<soapenv:Body>
<urn:getProducts>
<urn:manyfields>data in field</urn:manyfields>
</urn:getProducts>
</soapenv:Body>
</soapenv:Envelope> as you can see there is no namespace one body, while the nested elements do have a prefix. im am using 2 namespaces on the envelope like the following #[derive(YaSerialize, YaDeserialize, Debug, Default, Clone, Eq, PartialEq)]
#[yaserde(
rename = "Envelope",
namespaces = {
"soapenv" = "http://schemas.xmlsoap.org/soap/envelope/",
"urn" = "urn:something"
},
prefix = "soapenv"
)]
pub struct SoapEnvelope<BODY> |
The main issue is the miss of the declaration of |
Im having trouble deserializing with prefixes
serializing the following:
this yields:
the text elements is serialized with the prefix
this now errors with
value: "text is a required field of Body"
when the prefix is removed from the text element it will serialize without a problem
if this xml is deserialized with the urn prefix on the text element. the prefix is ignored and the xml is deserialized without error..
so it seems that the deserializer is ignoring the prefix.
The text was updated successfully, but these errors were encountered: