|
1 | 1 | # HTTP and gRPC Transcoding |
2 | 2 |
|
3 | | -APIs that follow [resource-oriented design][resources] are defined using |
| 3 | +APIs that follow [resource-oriented design][aep-121] are defined using |
4 | 4 | [RPCs][rpc], but the resource-oriented design framework allows them to also be |
5 | 5 | presented as APIs that largely follow REST/JSON conventions. This is important |
6 | 6 | in order to help developers use their existing knowledge: over 80% of the |
@@ -84,8 +84,10 @@ message CreateBookRequest { |
84 | 84 | - The `body` **must not** contain a nested field (or use the `.` character), |
85 | 85 | - The `body` **must not** be the same as a URI parameter. |
86 | 86 | - The `body` **must not** be a `repeated` field. |
87 | | - - Fields **should not** use the `json_name` annotation to alter the field |
88 | | - name in JSON, unless doing so for backwards-compatibility reasons. |
| 87 | + - In accordance with the [field name casing guidelines][field case], fields |
| 88 | + **should** use the `json_name` annotation to specify the snake_case form |
| 89 | + when the default JSON conversion would differ, unless this would break |
| 90 | + backwards compatibility. |
89 | 91 |
|
90 | 92 | **Note:** Bi-directional streaming RPCs should not include a `google.api.http` |
91 | 93 | annotation at all. If feasible, the service **should** provide non-streaming |
@@ -121,7 +123,8 @@ rpc CreateBook(CreateBookRequest) returns (Book) { |
121 | 123 |
|
122 | 124 | <!-- prettier-ignore-start --> |
123 | 125 | [json encoding]: https://developers.google.com/protocol-buffers/docs/proto3#json |
124 | | -[resources]: ./0121.md |
| 126 | +[aep-121]: ./0121.md |
| 127 | +[field case]: ./0140.md#case |
125 | 128 | [rpc]: https://en.wikipedia.org/wiki/Remote_procedure_call |
126 | 129 | [google.api.http]: https://buf.build/googleapis/googleapis/docs/main:google.api#google.api.Http |
127 | 130 | <!-- prettier-ignore-end --> |
0 commit comments