Skip to content

Commit 5dc78d1

Browse files
authored
chore: field names must not be verbs. (#1078)
chore: field names must not be verbs. Add guidance that field names must not be expressed in the context of imperatives or actions, as verbs. Fixes: #1077
1 parent 27e63a2 commit 5dc78d1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

aip/general/0140.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,20 @@ For uniformity, field names that contain both a noun and an adjective
8888
- `collected_items` (**not** `items_collected`)
8989
- `imported_objects` (**not** `objects_imported`)
9090

91+
### Verbs
92+
93+
Field names **must not** be named to reflect an intent or action. They
94+
**must not** be verbs. Rather, because the field defines the *desired
95+
value* for mutations, e.g. Create and Update, and the *current value*
96+
for reads, e.g. Get and List, the name **must** be a noun. It defines
97+
what is so, not what to do.
98+
99+
- `collected_items` (**not** `collect_items`)
100+
- `disabled` (**not** `disable`)
101+
102+
In contrast, method names, whether standard or custom, change facets of
103+
resources and are named as verbs.
104+
91105
### Booleans
92106

93107
Boolean fields **should** omit the prefix "is". For example:
@@ -142,6 +156,7 @@ field **should not** have a uniqueness requirement.
142156

143157
## Changelog
144158

159+
- **2023-04-25**: Field names **must not** be expressed as verbs.
145160
- **2021-07-12**: Normalized display name guidance to "should".
146161
- **2021-04-07**: Added base64 and bytes guidance.
147162
- **2021-03-05**: Added prohibition on leading, trailing, or adjacent

0 commit comments

Comments
 (0)