Skip to content

Commit e6d1b76

Browse files
fix(AIP-156): Do not define Update on singletons with only output only fields. (#1188)
Clarifying that singletons with only OUTPUT_ONLY fields do not require an Update method.
1 parent 55797f4 commit e6d1b76

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

aip/general/0156.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ always exist by virtue of the existence of its parent, with one and exactly one
2020
per parent.
2121

2222
For example:
23+
2324
```proto
2425
message Config {
2526
option (google.api.resource) = {
@@ -32,6 +33,7 @@ message Config {
3233
```
3334

3435
The `Config` singleton would have the following RPCs:
36+
3537
```proto
3638
rpc GetConfig(GetConfigRequest) returns (Config) {
3739
option (google.api.http) = {
@@ -57,12 +59,15 @@ rpc UpdateConfig(UpdateConfigRequest) returns (Config) {
5759
- Singleton resources **should** define the [`Get`][aip-131] and
5860
[`Update`][aip-134] methods, and **may** define custom methods as
5961
appropriate.
62+
- However, singleton resources **must not** define the [`Update`][aip-134]
63+
method if all fields on the resource are [output only][aip-203].
6064
- Singleton resources are always singular.
61-
- Example: 'users/1234/thing'
65+
- Example: `users/1234/thing`
6266
- Singleton resources **may** parent other resources.
6367

6468
## Changelog
6569

70+
- **2023-07-26:** Clarified that read-only singletons should not have `Update`.
6671
- **2021-11-02:** Added an example message and state parent eligibility.
6772
- **2021-01-14:** Changed example from `settings` to `config` for clarity.
6873

@@ -72,3 +77,4 @@ rpc UpdateConfig(UpdateConfigRequest) returns (Config) {
7277
[aip-133]: ./0133.md
7378
[aip-134]: ./0134.md
7479
[aip-135]: ./0135.md
80+
[aip-203]: ./0203.md#output-only

0 commit comments

Comments
 (0)