@@ -64,6 +64,11 @@ However, keep the following guidelines in mind when doing this:
6464 resources.
6565 - Any field being populated by clients ** must** have a default behavior
6666 matching the behavior before the field was introduced.
67+ - This can be tricky to do in some cases. For example, adding pagination
68+ after the fact where previously all items were returned (i.e. ` page_size `
69+ is infinite, which is not advised). If the default for the new ` page_size `
70+ field is _ less_ than what was previously returned, older clients will
71+ incorrectly assume all results were returned.
6772 - Any field previously populated by the server ** must** continue to be
6873 populated, even if it introduces redundancy.
6974- For enum values specifically, be aware that it is possible that user code
@@ -113,6 +118,15 @@ Existing fields and messages **must not** have their type changed, even if the
113118new type is wire-compatible, because type changes alter generated code in a
114119breaking way.
115120
121+ ### Changing string length
122+
123+ APIs ** should** avoid increasing the upper bound for the size or limit (if
124+ accepted as input) of ` string ` fields. APIs ** should** treat expected size upper
125+ bound increases as incompatible changes (see [ Changing resource names]
126+ (#changing-resource-names) as an example). APIs ** may** pad out values with
127+ filler characters if reserving a consistent size is necessary, but this ** must**
128+ be documented if done.
129+
116130### Changing resource names
117131
118132A resource ** must not** change its [ name] [ aip-122 ] .
@@ -146,6 +160,15 @@ code, as such changes will be seen as breaking by those users.
146160whether a proposed change is likely to break users, and an expansive reading of
147161this guidance could ostensibly prevent _ any_ change (which is not the intent).
148162
163+ #### Changing value format or construction
164+
165+ APIs ** must not** change the expected format or algorithm used to construct the
166+ value of an existing field - even if the field is ` OUTPUT_ONLY ` and populated by
167+ the API service - within an API version. Doing so requires a new API version.
168+
169+ For example, changing the format of a field ` ip_address ` conforming to IPv4
170+ format to instead contain IPv6 values is a breaking change.
171+
149172#### Default values must not change
150173
151174Default values are the values set by servers for resources when they are not
@@ -245,8 +268,27 @@ version.
245268- For compatibility around field presence changes, see [ AIP-149] [ ] .
246269- For compatibility around resource types, see [ AIP-123] [ ] .
247270
271+ ## Rationale
272+
273+ ### Risk of string length changes
274+
275+ End users may store resource properties, like the ` name ` , in a dedicated
276+ database column with a limited length. If the service starts returning values
277+ for the ` name ` that are twice the originally documented/observed length, this
278+ may unexpectedly break the customer's database. Furthermore, string properties
279+ that appear in URLs (including query parameters) are especially likely to have
280+ client-side limits, making them more sensitive to length changes.
281+
282+ ### Risk of changing value format or construction
283+
284+ Customers often depend on the format or algorithmic construction of a field for
285+ client-side parsing, hashing, or database table construction. Changing it in
286+ an existing field could break that client-side consumption.
287+
248288## Changelog
249289
290+ - ** 2025-10-21** : Added guidance for string length changes, changing formats,
291+ and an example for carefully adding components.
250292- ** 2024-08-07** : Added reference to resource type compatibility.
251293- ** 2024-06-05** : Added reference to field presence compatibility.
252294- ** 2023-07-26** : Added reference to field behavior compatibility.
0 commit comments