Skip to content

Commit 842e930

Browse files
authored
fix(AIP-122): remove redundant guidance on user-settable (#1139)
Guidance on user-settable IDs are already defined in AIP-133. Reiterating the guidance in AIP-122 is redundant and can make maintaining guidance more difficult. Also consolidating terminlogy to "user-specified" IDs, which is how it is currently referred to.
1 parent 7a3a67a commit 842e930

2 files changed

Lines changed: 19 additions & 27 deletions

File tree

aip/general/0122.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -108,30 +108,22 @@ A resource ID segment identifies the resource within its parent collection. In
108108
the resource name `publishers/123/books/les-miserables`, `123` is the resource
109109
ID for the publisher, and `les-miserables` is the resource ID for the book.
110110

111-
- Resource IDs **may** be either always set by users (required on resource
112-
creation), optionally set by users (optional on resource creation,
113-
server-generated if unset), or never set by users (not accepted at resource
114-
creation). They **should** be immutable once created.
115-
- If resource IDs are user-settable, the API **must** document allowed
116-
formats. User-settable resource IDs **should** conform to [RFC-1034][];
117-
which restricts to letters, numbers, and hyphen, with the first character
118-
a letter, the last a letter or a number, and a 63 character maximum.
119-
- Additionally, user-settable resource IDs **should** restrict letters to
120-
lower-case (`^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`).
121-
- Characters outside of ASCII **should not** be permitted; however, if
122-
Unicode characters are necessary, APIs **must** follow guidance in
123-
[AIP-210][].
124-
- User-settable IDs **should not** be permitted to be a UUID (or any value
125-
that syntactically appears to be a UUID).
126-
- If resource IDs are not user-settable, the API **should** document the
127-
basic format, and any upper boundaries (for example, "at most 63
128-
characters").
129-
- For more information, see the [create][] standard method.
130-
131-
**Important:** Resources that are declarative-friendly ([AIP-128][]) **must** use
132-
user-settable resource IDs.
133-
134-
[aip-128]: ./0128.md
111+
- If resource IDs are user-specified, the API **must** document allowed
112+
formats. User-specified resource IDs **should** conform to [RFC-1034][];
113+
which restricts to letters, numbers, and hyphen, with the first character
114+
a letter, the last a letter or a number, and a 63 character maximum.
115+
- Additionally, user-specified resource IDs **should** restrict letters to
116+
lower-case (`^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`).
117+
- Characters outside of ASCII **should not** be permitted; however, if
118+
Unicode characters are necessary, APIs **must** follow guidance in
119+
[AIP-210][].
120+
- User-specified IDs **should not** be permitted to be a UUID (or any value
121+
that syntactically appears to be a UUID).
122+
- If resource IDs are not user-settable, the API **should** document the
123+
basic format, and any upper boundaries (for example, "at most 63
124+
characters").
125+
- For more information, see the [create][] standard method.
126+
135127
[create]: ./0133.md#user-specified-ids
136128
[rfc-1034]: https://tools.ietf.org/html/rfc1034
137129

aip/general/0133.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,16 @@ NOT_FOUND errors][permission-denied].
185185

186186
## Rationale
187187

188-
### Requiring client-settable ids
188+
### Requiring user-specified ids
189189

190190
[IaC][] clients use the resource ID as a way to identify a resource for applying
191-
updates and for conflict resolution. The lack of a client-settable ID means a
191+
updates and for conflict resolution. The lack of a user-specified ID means a
192192
client is unable to find the resource unless they store the identifier locally,
193193
and can result in re-creating the resource. This in turn has a downstream effect
194194
on all resources that reference it, forcing them to update to the the ID of the
195195
newly-created resource.
196196

197-
Having a client-settable ID also means the client can precalculate the resource
197+
Having a user-specified ID also means the client can precalculate the resource
198198
name and use it in references from other resources.
199199

200200
[aip-121]: ./0121.md

0 commit comments

Comments
 (0)