Skip to content

feat: add support for 'hyphenated' format in the serde module#865

Merged
KodrAus merged 1 commit intouuid-rs:mainfrom
FrenchDilettante:main
Mar 13, 2026
Merged

feat: add support for 'hyphenated' format in the serde module#865
KodrAus merged 1 commit intouuid-rs:mainfrom
FrenchDilettante:main

Conversation

@FrenchDilettante
Copy link
Contributor

Hi folks, this is my first PR against this project, so if I'm doing anything wrong, by all means please let me know and I'll update it 🙏

While using the serde feature, I noticed that it lacks support for the hyphenated format:

#[derive(Deserialize)]
struct Product {
    [serde(with = "uuid::serde::hyphenated")],
    id: Uuid,
    label: String,
}

Looking at the code, I found out that the format is supported by the library, just missing from the serde feature itself. There was an issue documenting that gap: #534

While I was at it, I also fixed a couple of typos in the doc strings (serailized / serialized).

Copy link
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @FrenchDilettante! This change looks good to me. The only issue I spotted in the docs is also present in all the other serde modules. It's not something you've introduced. Clearly we need to do some more work in this area of the codebase to clean it up 🙂

This module would have been originally missing because the default text format is hyphenated, but introducing a dedicated module for it makes sense because that module forces binary-based formats to still use hyphenated strings, and rejects non hyphenated formats.

@KodrAus KodrAus merged commit 462495d into uuid-rs:main Mar 13, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants