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.
This commit is contained in:
Oliver Gugger 2020-02-11 14:07:27 +01:00
parent 165769ea82
commit e435cd5fc6
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -57,6 +57,7 @@ func printJSON(resp interface{}) {
func printRespJSON(resp proto.Message) {
jsonMarshaler := &jsonpb.Marshaler{
EmitDefaults: true,
OrigName: true,
Indent: " ",
}