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

Remove extra newline when pretty printing text serialized from foreing types #813

Closed
RedIODev opened this issue Sep 30, 2024 · 1 comment
Labels
bug duplicate serde Issues related to mapping from Rust types to XML

Comments

@RedIODev
Copy link

RedIODev commented Sep 30, 2024

I currently have the problem that serializing types that serialize to text are not placed inline but on their own line.
Example:

use uuid::Uuid;
#[derive(From, Debug, Serialize, Deserialize)]
pub struct Guid {
    #[serde(rename = "@type")]
    pub id_type: String,
    #[serde(with = "simple_uuid")]
    #[serde(rename = "$text")]
    pub id: Uuid,
}

is serialized to (when the guid field is named "book:id"):

<book:id type="guid">
  3e114c9829ce41728902866e39b4e5c7
</book:id>

The required formatting for the target application is:

<book:id type="guid">3e114c9829ce41728902866e39b4e5c7</book:id>

I haven't found a way to change this behavior.
Great regards
RedIODev

@RedIODev RedIODev changed the title remov Remove extra newline when pretty printing text serialized from foreing types Sep 30, 2024
@Mingun Mingun added bug duplicate serde Issues related to mapping from Rust types to XML labels Sep 30, 2024
@Mingun
Copy link
Collaborator

Mingun commented Sep 30, 2024

Duplicate of #729

@Mingun Mingun marked this as a duplicate of #729 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 duplicate serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

No branches or pull requests

2 participants