github.com/googleapis/api-linter@v1.65.2/docs/rules/0134/method-signature.md (about) 1 --- 2 rule: 3 aip: 134 4 name: [core, '0134', method-signature] 5 summary: | 6 Update RPCs should annotate an appropriate method signature. 7 permalink: /134/method-signature 8 redirect_from: 9 - /0134/method-signature 10 --- 11 12 # Update methods: Method signature 13 14 This rule enforces that all `Update` standard methods have a 15 `google.api.method_signature` annotation with an appropriate value, as mandated 16 in [AIP-134][]. 17 18 ## Details 19 20 This rule looks at any method beginning with `Update`, and complains if the 21 `google.api.method_signature` annotation is missing, or if it is set to an 22 value other than `"{resource},update_mask`. Additional method signatures, if 23 present, are ignored. 24 25 ## Examples 26 27 **Incorrect** code for this rule: 28 29 ```proto 30 // Incorrect. 31 rpc UpdateBook(UpdateBookRequest) returns (Book) { 32 // A google.api.method_signature annotation should be present. 33 } 34 ``` 35 36 ```proto 37 // Incorrect. 38 rpc UpdateBook(UpdateBookRequest) returns (Book) { 39 // Should be "book,update_mask". 40 option (google.api.method_signature) = "book"; 41 } 42 ``` 43 44 **Correct** code for this rule: 45 46 ```proto 47 // Correct. 48 rpc UpdateBook(UpdateBookRequest) returns (Book) { 49 option (google.api.method_signature) = "book,update_mask"; 50 } 51 ``` 52 53 ## Disabling 54 55 If you need to violate this rule, use a leading comment above the method. 56 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 57 58 ```proto 59 // (-- api-linter: core::0134::method-signature=disabled 60 // aip.dev/not-precedent: We need to do this because reasons. --) 61 rpc UpdateBook(UpdateBookRequest) returns (Book) { 62 option (google.api.method_signature) = "book"; 63 } 64 ``` 65 66 If you need to violate this rule for an entire file, place the comment at the 67 top of the file. 68 69 [aip-134]: https://aip.dev/134 70 [aip.dev/not-precedent]: https://aip.dev/not-precedent