Skip to content

Commit 51a30ec

Browse files
authored
fix(AIP-154): allow behavior annotations on request etag (#953)
1 parent 0295465 commit 51a30ec

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

aip/general/0154.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ message Book {
3838
```
3939

4040
- The etag field **must** be a string, and **must** be named `etag`.
41-
- The etag field **should not** be given any behavior annotations
41+
- The etag field on the _resource_ **should not** be given any behavior
42+
annotations.
4243
- The etag field **must** be provided by the server on output, and values
4344
**should** conform to [RFC 7232][].
4445
- If a user sends back an etag which matches the current etag value, the
@@ -78,10 +79,13 @@ message DeleteBookRequest {
7879
// The current etag of the book.
7980
// If an etag is provided and does not match the current etag of the book,
8081
// deletion will be blocked and an ABORTED error will be returned.
81-
string etag = 2;
82+
string etag = 2 [(google.api.field_behavior) = OPTIONAL];
8283
}
8384
```
8485

86+
On a request message, the `etag` field **should** be given a behavior annotation
87+
- either `REQUIRED` or `OPTIONAL`. See AIP-203 for more information.
88+
8589
An `etag` field **may** also be used on custom methods, similar to the example
8690
above.
8791

0 commit comments

Comments
 (0)