From e435cd5fc6326c7e8c13962b394fd48e59c80bf6 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 11 Feb 2020 14:07:27 +0100 Subject: [PATCH] lncli: use original snake_case names for JSON serializing Because we now use printRespJSON everywhere where we print RPC responses as JSON, we can simply instruct the jsonpb marshaler to use the original snake_case name specified in the proto file for the JSON field names and not the default camelCase. --- cmd/lncli/commands.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 281fbed9..608b8d3f 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -57,6 +57,7 @@ func printJSON(resp interface{}) { func printRespJSON(resp proto.Message) { jsonMarshaler := &jsonpb.Marshaler{ EmitDefaults: true, + OrigName: true, Indent: " ", }