From 261b341a02abb62a8dd164e179a6224d6f47683a Mon Sep 17 00:00:00 2001 From: David Weitzman Date: Tue, 26 Feb 2019 14:15:55 -0800 Subject: [PATCH] Use jsonpb marshaling for vtctl's GetVSchema 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 --- go/vt/vtctl/vtctl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index c4c6e9e4544..7dd78e0153b 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -2108,7 +2108,7 @@ func commandGetVSchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *fla if err != nil { return err } - b, err := json.MarshalIndent(schema, "", " ") + b, err := json2.MarshalIndentPB(schema, " ") if err != nil { wr.Logger().Printf("%v\n", err) return err