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

Use jsonpb marshaling for vtctl's GetVSchema #4676

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

dweitzman
Copy link
Member

Protobufs should generally go through jsonpb to convert to and from json.
One specific thing that's different with jsonpb's encoding is that
"columnListAuthoritative" is camelCase vs json's encoding using snake_case.

jsonpb is lenient about parsing json, accepting either snake or camel case.

There's a risk that custom scripts based on the old behavior of GetVSchema might break if they only support snake case and parse the output. jsonpb's Unmarshal() should accept either snake or camel case.

Signed-off-by: David Weitzman [email protected]

Protobufs should generally go through jsonpb to convert to and from json.
One specific thing that's different with jsonpb's encoding is that
"columnListAuthoritative" is camelCase vs json's encoding using snake_case.

jsonpb is lenient about parsing json, accepting either snake or camel case.

Signed-off-by: David Weitzman <[email protected]>
@dweitzman dweitzman requested a review from sougou as a code owner February 26, 2019 22:31
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

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

You can merge once the tests pass.

@dweitzman dweitzman merged commit 8316f8f into vitessio:master Feb 27, 2019
@dweitzman dweitzman deleted the getvschema_json_pb_format branch February 27, 2019 09:47
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