Skip to content

Commit e487231

Browse files
Update the resource revisions guide using nested collections (take 2) (#1192)
Moving resource revisions to a collection-oriented pattern, reducing exceptional situations (see rationale in diff for more information). --------- Co-authored-by: Difan Chen <[email protected]>
1 parent cee645b commit e487231

File tree

2 files changed

+166
-294
lines changed

2 files changed

+166
-294
lines changed

aip/general/0122.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,6 @@ When a field represents another resource, the field **should** be of type
282282
`string` and accept the resource name of the other resource. The field name
283283
**should** be equivalent to the corresponding message's name in snake case.
284284

285-
The field **should not** be of type `message` using the `message` that
286-
implements the resource, _unless_ the API is internal-only, has tight lifecycle
287-
relationships, and has a permission model that enables inherited access to
288-
embedded resources.
289-
290285
- Field names **may** include a leading adjective if appropriate (such as
291286
`string dusty_book`).
292287
- Field names **should not** use the `_name` suffix unless the field would be
@@ -297,6 +292,16 @@ embedded resources.
297292
- If using the resource name is not possible and using the ID component alone is
298293
strictly necessary, the field **should** use an `_id` suffix (e.g. `shelf_id`).
299294

295+
The field **should not** be of type `message` using the `message` that
296+
implements the resource, __except__ for one of following conditions:
297+
298+
- The API is internal-only, has tight lifecycle relationships, and has a
299+
permission model that enables inherited access to embedded resources.
300+
- The embedding of the resource is done as part of the AIP-162 revisions
301+
pattern.
302+
303+
Example of a resource reference:
304+
300305
```proto
301306
// A representation of a book in a library.
302307
message Book {
@@ -349,6 +354,8 @@ isolation of logical concerns per-resource.
349354

350355
## Changelog
351356

357+
- **2023-09-01**: Add a clause that allows embedding for revision resource
358+
messages.
352359
- **2023-08-10**: Explicitly disallow embedding resource messages in a resource.
353360
- **2023-03-24**: Correction: full resource name contains the service name rather
354361
than the service endpoint

0 commit comments

Comments
 (0)