Skip to content
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

enum text content is (incorrectly) indented #729

Closed
torkleyy opened this issue Mar 21, 2024 · 2 comments
Closed

enum text content is (incorrectly) indented #729

torkleyy opened this issue Mar 21, 2024 · 2 comments
Labels
bug help wanted serde Issues related to mapping from Rust types to XML

Comments

@torkleyy
Copy link

#[derive(Clone, Debug, Serialize, PartialEq)]
#[serde(rename = "response")]
pub struct Response {
    #[serde(rename = "intent", with = "quick_xml::serde_helpers::text_content")]
    pub intent: Intent,
}

#[derive(Clone, Debug, Serialize, PartialEq)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Intent {
    Accept,
    Reject,
}

results in

<response>
  <intent>
    ACCEPT
  </intent>
</response>

when indentation is enabled. In my understanding it's incorrect that the element content (intent) contains whitespace.

@Mingun Mingun added bug help wanted serde Issues related to mapping from Rust types to XML labels Mar 21, 2024
@Mingun
Copy link
Collaborator

Mingun commented Mar 21, 2024

Yes, I think, this is undesired behavior and we need to fix it

@Mingun
Copy link
Collaborator

Mingun commented Sep 30, 2024

Duplicate of #655

@Mingun Mingun marked this as a duplicate of #655 Sep 30, 2024
@Mingun Mingun closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

No branches or pull requests

2 participants