From 3414277b8902c89ca625b2cca5e7c79bfd7908a5 Mon Sep 17 00:00:00 2001 From: kolena Date: Fri, 7 Sep 2018 14:36:19 +0200 Subject: [PATCH] Printer preserves proto names --- .../com/avast/grpc/jsonbridge/GrpcJsonBridgeBase.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/com/avast/grpc/jsonbridge/GrpcJsonBridgeBase.scala b/core/src/main/scala/com/avast/grpc/jsonbridge/GrpcJsonBridgeBase.scala index 7d7c9055..43c5e70b 100644 --- a/core/src/main/scala/com/avast/grpc/jsonbridge/GrpcJsonBridgeBase.scala +++ b/core/src/main/scala/com/avast/grpc/jsonbridge/GrpcJsonBridgeBase.scala @@ -1,6 +1,6 @@ package com.avast.grpc.jsonbridge -import cats.effect.{Async, Effect} +import cats.effect.Async import cats.syntax.all._ import com.avast.grpc.jsonbridge.GrpcJsonBridge.GrpcHeader import com.google.protobuf.Message @@ -21,7 +21,9 @@ abstract class GrpcJsonBridgeBase[F[_], Stub <: io.grpc.stub.AbstractStub[Stub]] protected def newFutureStub: Stub protected val parser: JsonFormat.Parser = JsonFormat.parser() - protected val printer: JsonFormat.Printer = JsonFormat.printer().includingDefaultValueFields().omittingInsignificantWhitespace() + protected val printer: JsonFormat.Printer = { + JsonFormat.printer().includingDefaultValueFields().omittingInsignificantWhitespace().preservingProtoFieldNames() + } // https://groups.google.com/forum/#!topic/grpc-io/1-KMubq1tuc protected def withNewClientStub[A](headers: Seq[GrpcHeader])(f: Stub => Future[A])(