You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/customizingyourgateway.md
+28-53Lines changed: 28 additions & 53 deletions
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,21 @@ You might want to serialize request/response messages in MessagePack instead of
23
23
24
24
You can see [the default implementation for JSON](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/runtime/marshal_jsonpb.go) for reference.
25
25
26
-
### Using camelCase for JSON
26
+
### Using proto names in JSON
27
27
28
-
The protocol buffer compiler generates camelCase JSON tags that can be used with jsonpb package. By default jsonpb Marshaller uses `OrigName: true` which uses the exact case used in the proto files. To use camelCase for the JSON representation,
28
+
The protocol buffer compiler generates camelCase JSON tags that are used by default.
29
+
If you want to use the exact case used in the proto files, set `UseProtoNames: true`:
Copy file name to clipboardExpand all lines: docs/_docs/httpbody.md
+1-7Lines changed: 1 addition & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,7 @@ category: documentation
6
6
The [HTTP Body](https://github.com/googleapis/googleapis/blob/master/google/api/httpbody.proto) messages allows a response message to be specified with custom data content and a custom content type header. The values included in the HTTPBody response will be used verbatim in the returned message from the gateway. Make sure you format your response carefully!
7
7
8
8
## Example Usage
9
-
1. Create a mux and configure it to use the `HTTPBodyMarshaler`.
10
-
11
-
```protobuf
12
-
mux := runtime.NewServeMux()
13
-
runtime.SetHTTPBodyMarshaler(mux)
14
-
```
15
-
2. Define your service in gRPC with an httpbody response message
9
+
1. Define your service in gRPC with an httpbody response message
0 commit comments