Skip to content

Commit 43fea20

Browse files
committed
feat(AIP-122): require parent in resource name
It is a common use case to first look up the parent resource, then perform an operation on a child. If the child does not incude the resource name of the parent, the consumer of the resource must choose from a set of non-optimal approaches to find the parent: 1. Perform a read of the child resource, then look up a custom field on the child to find the parent (assuming such a field exists). 1. Add another field where one specifies the parent of a resource in addition to the child resource.
1 parent b5e24a2 commit 43fea20

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

aip/general/0122.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ the leading slash:
5252
[`OUTPUT_ONLY`](./0203.md#output-only) field behavior classification.
5353
- Resources **must not** expose tuples, self-links, or other forms of
5454
resource identification.
55+
- Resources **must** include their parent's resource name in their resource
56+
names.
5557
- All ID fields **should** be strings.
5658

5759
**Note:** Resource names as described here are used within the scope of a
@@ -322,6 +324,20 @@ message Book {
322324
}
323325
```
324326

327+
## Rationale
328+
329+
### Including the parent resource name in the resource name
330+
331+
It is a common use case to first look up the parent resource, then perform an
332+
operation on a child. If the child does not incude the resource name of the
333+
parent, the consumer of the resource must choose from a set of non-optimal
334+
approaches to find the parent:
335+
336+
1. Perform a read of the child resource, then look up a custom field on the
337+
child to find the parent (assuming such a field exists).
338+
1. Add another field where one specifies the parent of a resource in addition to
339+
the child resource.
340+
325341
## Further reading
326342

327343
- For evolving resource names over time, see

0 commit comments

Comments
 (0)