Skip to content

Commit c26449d

Browse files
authored
fix(AIP-4235): update generator behavior for explicit field presence (#1325)
* fix: update 4235 to include explicit field presence * update * reword to positive
1 parent fb9b087 commit c26449d

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

aip/client-libraries/4235.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ created: 2024-03-07
77
# Automatically populate fields in the request message
88

99
For APIs that leverage request idempotency as described via [AIP-155], APIs may
10-
choose to have the client libraries automatically populate fields such as
10+
choose to have the client libraries automatically populate fields such as
1111
`request_id` if they are not already set by the customer.
1212

1313
**Note:** This feature is primarily written for `request_id` fields within the
@@ -38,14 +38,21 @@ If the aforementioned requirements are met for a given field, client library
3838
generators **must** enable automatic population of said field in the
3939
generated client.
4040

41+
The field **must** be automatically populated if and only if one of the
42+
following conditions holds:
43+
44+
- The field supports explicit presence, and has **not** been set by the user
45+
- The field doesn't support explicit presence, and its value is the empty
46+
string (i.e. the default value)
47+
4148
If a field is specified in the `auto_populated_fields`, but does not meet the
4249
structural requirements, the client library generators **must not** enable
4350
automatic population for that field. Client library generators **may** emit an
4451
error during generation.
4552

4653
Client libraries **must** reuse automatically populated values for retries of
47-
the same request. In other words, the automatically populated fields **must not**
48-
be regenerated for each RPC attempt with the same request message.
54+
the same request. In other words, the automatically populated fields
55+
**must not** be regenerated for each RPC attempt with the same request message.
4956

5057
[AIP-155]: https://google.aip.dev/155
5158

0 commit comments

Comments
 (0)