Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions aip/general/0127.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ rpc CreateBook(CreateBookRequest) returns (Book) {
post: "/v1/books"
body: "book"
}
additional_bindings: {
get: "/v1/books:Create"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regardless of whether we allow GET / POST mappings, we definitely shouldn't add this example - this is a Create RPC, and creates must use POST along with map to a resource pattern: https://google.aip.dev/133#guidance

}
};
}
```
Expand All @@ -124,11 +127,14 @@ rpc CreateBook(CreateBookRequest) returns (Book) {
identical to the `google.api.http` annotation (in fact, it is a recursive
reference).
- RPCs **must not** define an additional binding within an additional binding.
- The `body` clause **must** be identical in the top-level annotation and each
additional binding.
- The `body` clause **must** be identical for `POST` methods in the top-level
annotation and each additional binding.
- One RPC can have HTTP bindings to both `GET` and `POST`.

## Changelog

- **2023-07-06**: Added the comment that it is possible to allow multiple uri
bindings with both HTTP `GET` and `POST`.
- **2022-08-18**: Added the comment that query string parameter names are
in camelCase.
- **2021-01-06**: Added clarification around `body` and nested fields.
Expand Down