Skip to content

Fix ScopedIp serialization with MessagePack#472

Merged
keepsimple1 merged 1 commit into
keepsimple1:mainfrom
rabbit-time:main
May 23, 2026
Merged

Fix ScopedIp serialization with MessagePack#472
keepsimple1 merged 1 commit into
keepsimple1:mainfrom
rabbit-time:main

Conversation

@rabbit-time
Copy link
Copy Markdown
Contributor

@rabbit-time rabbit-time commented May 21, 2026

The serde(untagged) attribute on Enums breaks serialization with binary formats like MessagePack.

I originally added that tag to optimize the redundant structures when serializing, but this can also be achieved when using serde(flatten) on a per-implementation basis.

Through my own testing using rmp-serde, I can confirm that it works after this change. If requested, I can write an additional test to cover this case.

EDIT: Actually not a problem with the format, seems like it's an issue with rmp-serde.

Copy link
Copy Markdown
Owner

@keepsimple1 keepsimple1 left a comment

Choose a reason for hiding this comment

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

I'm OK with the change. The only thing is that this is a breaking change.

Let's think a bit more for a day. (My current thought is that this change is good for long term)

Copy link
Copy Markdown
Owner

@keepsimple1 keepsimple1 left a comment

Choose a reason for hiding this comment

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

Let's go with it!

@keepsimple1 keepsimple1 merged commit 5fa4b92 into keepsimple1:main May 23, 2026
3 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