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

Clarify Msgpack handling of json tags #7924

Merged
merged 2 commits into from
May 11, 2020
Merged

Clarify Msgpack handling of json tags #7924

merged 2 commits into from
May 11, 2020

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented May 11, 2020

When serializing structs with msgpack, only consider type tags of
codec.

Hashicorp/go-msgpack (based on ugorji/go) defaults to interpretting
codec tag if it's available, but falls to using json if codec
isn't present.

This behavior is surprising in cases where we want to serialize json
differently from msgpack, e.g. serializing ConsulExposeConfig.

This is a follow up to #7690

Mahmood Ali added 2 commits May 11, 2020 14:05
No need to maintain two msgpack handles!
When serializing structs with msgpack, only consider type tags of
`codec`.

Hashicorp/go-msgpack (based on ugorji/go) defaults to interpretting
`codec` tag if it's available, but falls to using `json` if `codec`
isn't present.

This behavior is surprising in cases where we want to serialize json
differently from msgpack, e.g. serializing `ConsulExposeConfig`.
@notnoop notnoop requested a review from shoenig May 11, 2020 18:26
@notnoop notnoop self-assigned this May 11, 2020
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

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

LGTM!

@notnoop notnoop merged commit 55fa55c into master May 11, 2020
@notnoop notnoop deleted the b-codecgen-flags branch May 11, 2020 19:04
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants