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

Open
torkleyy opened this issue Mar 21, 2024 · 1 comment
Open

enum text content is (incorrectly) indented #729

torkleyy opened this issue Mar 21, 2024 · 1 comment
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

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