<p>I have deployed a gRPC server using Google Cloud Endpoints / ESP, following the instructions here:</p>

<p><a href="https://cloud.google.com/endpoints/docs/grpc/get-started-kubernetes-engine" rel="nofollow noreferrer">https://cloud.google.com/endpoints/docs/grpc/get-started-kubernetes-engine</a></p>

<p>In my proto file, my fields are named in snake_case, following the Protocol Buffers naming conventions (<a href="https://developers.google.com/protocol-buffers/docs/style#message-and-field-names" rel="nofollow noreferrer">https://developers.google.com/protocol-buffers/docs/style#message-and-field-names</a>), as below:</p>

<pre><code>message MyMessage {
  string my_field = 1;
}
</code></pre>

<p>When deploying to Cloud Endpoints, the field names are converted to camelCase. So if I call the API using the HTTP endpoint, the JSON response looks like this: </p>

<pre><code>{
  "myField":"field value"
}
</code></pre>

<p>If I call the service using a GRPC client (Node.js), the response object is returned in the original format:</p>

<pre><code>{
  "my_field":"field value"
}
</code></pre>

<p>The field names are also converted to camel case in the Cloud Endpoints Developer Portal documentation.</p>

<p>I'd prefer to use snake case for both GRPC and HTTP clients as I'm replacing an existing API. If I can prevent the field names from being converted, I can basically just switch the backend over to the new service without any changes to the client side.</p>

<p>Is there a way to force ESP to use the camel case field names when transcoding to HTTP/JSON?</p>

glv19
<p>I'm deploy my grpc application in to k8s with ESP, with the config below it will transcoding the protobuf response to snake case instead of camel case</p>

<pre><code>- name: esp
    image: gcr.io/endpoints-release/endpoints-runtime:1
    imagePullPolicy: Always
    args: [
      "--http_port=9000",
      "--backend=grpc://127.0.0.1:8080",
      "--service=xxxxxx",
      "--version=xxxxxx",
      "--transcoding_preserve_proto_field_names",
      "--transcoding_always_print_primitive_fields"
    ]
    ports:
    - name: http
      containerPort: 9000
</code></pre>
