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

Serialize/Deserialize Subject and HeaderName as strings #1168

Merged
merged 2 commits into from
Dec 1, 2023

Conversation

oscarwcl
Copy link
Contributor

@oscarwcl oscarwcl commented Dec 1, 2023

The default derives produce a very ugly serialization format for these wrappers. Since they are guaranteed to be strings it makes sense to serialize/deserialize them directly as strings.

This also makes it possible to implement Object Store object headers, since they need to deserialize a HeaderMap from JSON.

Subjects need to be valid UTF-8, so this is much nicer than a raw byte
array when using formats like JSON.
This is much more convenient, and is also required to implement Object
Store object headers, since they are serialized to JSON.
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for the contribution!

@Jarema Jarema merged commit 79a7635 into nats-io:main Dec 1, 2023
11 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.

3 participants