Skip to content

Commit 22fc686

Browse files
committed
Prohibit duplicate collection identifiers and pattern variables
1 parent ccc6608 commit 22fc686

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

aip/general/0122.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ form of the noun used for the resource. (For example, a collection of
7878
and plural terms are the same ("moose"), the non-pluralized (singular) form
7979
is correct. Collection segments **must not** "coin" words by adding "s" in
8080
such cases (e.g, avoid "infos").
81+
- Within any given single resource name, collection identifiers **must** be
82+
unique. (e.g. `people/xyz/people/abc` is invalid)
83+
8184

8285
#### Nested collections
8386

@@ -354,6 +357,7 @@ isolation of logical concerns per-resource.
354357

355358
## Changelog
356359

360+
- **2023-09-19**: Prohibit duplicate collection identifiers.
357361
- **2023-09-01**: Add a clause that allows embedding for revision resource
358362
messages.
359363
- **2023-08-10**: Explicitly disallow embedding resource messages in a resource.

aip/general/0123.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ message Topic {
7575
- Pattern variables (the segments within braces) **must** use `snake_case`, and
7676
**must not** use an `_id` suffix.
7777
- Pattern variables **must** conform to the format `[a-z][_a-z0-9]*[a-z0-9]`.
78+
- Pattern variables **must** be unique within any given pattern. (e.g.
79+
`projects/{abc}/topics/{abc}` is invalid; this is usually a natural
80+
corollary of collection identifiers being unique within a pattern.)
7881
- Singular **must** be the lower camel case of the type.
7982
- Pattern variables **must** be the singular form of the resource type e.g.
8083
a pattern variable representing a `Topic` resource ID is named `{topic}`.
@@ -116,6 +119,7 @@ such as UpperCamelCase and snake_case.
116119

117120
## Changelog
118121

122+
- **2023-09-19**: Prohibit duplicate pattern variables.
119123
- **2023-05-06**: Adding requirement of singular and plural.
120124
- **2023-01-28**: Clarifying guidance for the resource type name.
121125
- **2022-10-28**: Added pattern variable format guidance.

0 commit comments

Comments
 (0)