-
Notifications
You must be signed in to change notification settings - Fork 276
Open
Labels
enhancementnamespacesIssues related to namespaces supportIssues related to namespaces supportserdeIssues related to mapping from Rust types to XMLIssues related to mapping from Rust types to XML
Description
Hi,
it would be really cool to have a feature to define common namespaces for structs using serde. Something like this:
#[derive(Serialize, Deserialize)]
#[namespace(F,foourn)]
struct Foo {
id: String,
#[serde(flatten)]
#[namespace(B,barurn)]
bar: Bar
}
#[derive(Serialize, Deserialize)]
struct Bar {
name: String,
desc: String
}resulting in:
<F:foo xmlns:B="foourn" xmlns:F="barurn">
<F:id>123</F:id>
<B:name>asdf</B:name>
<B:desc>foobar </B:desc>
</F:foo>Background
I sometimes face (old) API's that requrie XML to be structured in a way similar to the given example. They use namespaces to distinguish between entities to form some sort of inheritance tree.
A feature like this would make interacting with these kind of API's very easy.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementnamespacesIssues related to namespaces supportIssues related to namespaces supportserdeIssues related to mapping from Rust types to XMLIssues related to mapping from Rust types to XML