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:
parent
165769ea82
commit
e435cd5fc6
@ -57,6 +57,7 @@ func printJSON(resp interface{}) {
|
|||||||
func printRespJSON(resp proto.Message) {
|
func printRespJSON(resp proto.Message) {
|
||||||
jsonMarshaler := &jsonpb.Marshaler{
|
jsonMarshaler := &jsonpb.Marshaler{
|
||||||
EmitDefaults: true,
|
EmitDefaults: true,
|
||||||
|
OrigName: true,
|
||||||
Indent: " ",
|
Indent: " ",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user