github.com/googleapis/api-linter@v1.65.2/docs/rules/0134/request-mask-field.md (about) 1 --- 2 rule: 3 aip: 134 4 name: [core, '0134', request-mask-field] 5 summary: Update RPCs must have a field mask in the request. 6 permalink: /134/request-mask-field 7 redirect_from: 8 - /0134/request-mask-field 9 --- 10 11 # Update methods: Mask field 12 13 This rule enforces that all `Update` standard methods have a field in the 14 request message for the field mask, as mandated in [AIP-134][]. 15 16 ## Details 17 18 This rule looks at any message matching `Update*Request` and complains if 19 the `update_mask` field has any type other than `google.protobuf.FieldMask`. 20 21 ## Examples 22 23 **Incorrect** code for this rule: 24 25 ```proto 26 // Incorrect. 27 message UpdateBookRequest { 28 Book book = 1; 29 // Field type should be `google.protobuf.FieldMask`. 30 string update_mask = 2; 31 } 32 ``` 33 34 **Correct** code for this rule: 35 36 ```proto 37 // Correct. 38 message UpdateBookRequest { 39 Book book = 1; 40 google.protobuf.FieldMask update_mask = 2; 41 } 42 ``` 43 44 ## Disabling 45 46 If you need to violate this rule, use a leading comment above the message (if 47 the resource field is missing) or above the field (if it is improperly named). 48 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 49 50 ```proto 51 message UpdateBookRequest { 52 Book book = 1; 53 // (-- api-linter: core::0134::request-mask-field=disabled 54 // aip.dev/not-precedent: We need to do this because reasons. --) 55 string update_mask = 2; 56 } 57 ``` 58 59 If you need to violate this rule for an entire file, place the comment at the 60 top of the file. 61 62 [aip-134]: https://aip.dev/134 63 [aip.dev/not-precedent]: https://aip.dev/not-precedent