Skip to content

namespace / prefixes not working #201

@Rex-Sanchez

Description

@Rex-Sanchez

Good day

It seems that the following attrs are not working.

default_namespace,
namespaces, 
prefix

as a example

#[derive(YaSerialize)]
#[yaserde(default_namespace = "namespace")]
struct S1 {
  field1: String,
  field2: String,
  #[yaserde(prefix = "prefix")]
  field3: String
}

one would expect something like the following to render

<namespace:field1></namespace:field1>
<namespace:field2></namespace:field2>
<prefix:field3></prefix:field3>

this is not the case and the prefix and default_namespace dont do anything at all. resulting in the following

<field1></field1>
<field2></field2>
<field3></field3>

I am now forced to do the following

#[derive(YaSerialize)]
struct S1 {
 #[yaserde(rename = "namespace:field1")]
  field1: String,
 #[yaserde(rename = "namespace:field1")]
  field2: String,
  #[yaserde(rename = "prefix:field1")]
  field3: String
}

am i doing something wrong or is this a bug..?

kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions