@@ -41,7 +41,7 @@ message Http {
4141 bool fully_decode_reserved_expansion = 2 ;
4242}
4343
44- // # gRPC Transcoding
44+ // gRPC Transcoding
4545//
4646// gRPC Transcoding is a feature for mapping between a gRPC method and one or
4747// more HTTP REST endpoints. It allows developers to build a single API service
@@ -82,9 +82,8 @@ message Http {
8282//
8383// This enables an HTTP REST to gRPC mapping as below:
8484//
85- // HTTP | gRPC
86- // -----|-----
87- // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
85+ // - HTTP: `GET /v1/messages/123456`
86+ // - gRPC: `GetMessage(name: "messages/123456")`
8887//
8988// Any fields in the request message which are not bound by the path template
9089// automatically become HTTP query parameters if there is no HTTP request body.
@@ -108,11 +107,9 @@ message Http {
108107//
109108// This enables a HTTP JSON to RPC mapping as below:
110109//
111- // HTTP | gRPC
112- // -----|-----
113- // `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
114- // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
115- // "foo"))`
110+ // - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
111+ // - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
112+ // SubMessage(subfield: "foo"))`
116113//
117114// Note that fields which are mapped to URL query parameters must have a
118115// primitive type or a repeated primitive type or a non-repeated message type.
@@ -142,10 +139,8 @@ message Http {
142139// representation of the JSON in the request body is determined by
143140// protos JSON encoding:
144141//
145- // HTTP | gRPC
146- // -----|-----
147- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
148- // "123456" message { text: "Hi!" })`
142+ // - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
143+ // - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
149144//
150145// The special name `*` can be used in the body mapping to define that
151146// every field not bound by the path template should be mapped to the
@@ -168,10 +163,8 @@ message Http {
168163//
169164// The following HTTP JSON to RPC mapping is enabled:
170165//
171- // HTTP | gRPC
172- // -----|-----
173- // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
174- // "123456" text: "Hi!")`
166+ // - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
167+ // - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
175168//
176169// Note that when using `*` in the body mapping, it is not possible to
177170// have HTTP parameters, as all fields not bound by the path end in
@@ -199,13 +192,13 @@ message Http {
199192//
200193// This enables the following two alternative HTTP JSON to RPC mappings:
201194//
202- // HTTP | gRPC
203- // -----|-----
204- // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
205- // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
206- // "123456")`
195+ // - HTTP: `GET /v1/messages/123456`
196+ // - gRPC: `GetMessage(message_id: "123456")`
207197//
208- // ## Rules for HTTP mapping
198+ // - HTTP: `GET /v1/users/me/messages/123456`
199+ // - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
200+ //
201+ // Rules for HTTP mapping
209202//
210203// 1. Leaf request fields (recursive expansion nested messages in the request
211204// message) are classified into three categories:
@@ -224,7 +217,7 @@ message Http {
224217// request body, all
225218// fields are passed via URL path and URL query parameters.
226219//
227- // ### Path template syntax
220+ // Path template syntax
228221//
229222// Template = "/" Segments [ Verb ] ;
230223// Segments = Segment { "/" Segment } ;
@@ -263,7 +256,7 @@ message Http {
263256// Document](https://developers.google.com/discovery/v1/reference/apis) as
264257// `{+var}`.
265258//
266- // ## Using gRPC API Service Configuration
259+ // Using gRPC API Service Configuration
267260//
268261// gRPC API Service Configuration (service config) is a configuration language
269262// for configuring a gRPC service to become a user-facing product. The
@@ -278,15 +271,14 @@ message Http {
278271// specified in the service config will override any matching transcoding
279272// configuration in the proto.
280273//
281- // Example :
274+ // The following example selects a gRPC method and applies an `HttpRule` to it :
282275//
283276// http:
284277// rules:
285- // # Selects a gRPC method and applies HttpRule to it.
286278// - selector: example.v1.Messaging.GetMessage
287279// get: /v1/messages/{message_id}/{sub.subfield}
288280//
289- // ## Special notes
281+ // Special notes
290282//
291283// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
292284// proto to JSON conversion must follow the [proto3
0 commit comments