uuid icon indicating copy to clipboard operation
uuid copied to clipboard

Option to serialize a nilUuid as NULL with serde

Open ronnybremer opened this issue 5 months ago • 0 comments

I opened a discussion on the serde_with repo to ask, if this feature could be implemented directly with serde_with: Discussion.

But since my original issue is with using Uuid, I would also like to hear your feedback and comments. When a Uuid is initialized to default() and then serialized with serde, it appears in the Json output as a string of all 0s (hyphenated by default). However, I would like to have the value be NULL in that case. Is there any way to do that without having to write a custom serializer for serde?

Thank you for your input.

ronnybremer avatar Jun 16 '25 09:06 ronnybremer