github.com/googleapis/api-linter@v1.65.2/docs/rules/0136/verb-noun.md (about) 1 --- 2 rule: 3 aip: 136 4 name: [core, '0136', verb-noun] 5 summary: Custom methods should be named with the verb, then the noun. 6 permalink: /136/verb-noun 7 redirect_from: 8 - /0136/verb-noun 9 --- 10 11 # Custom methods: Verb and noun 12 13 This rule enforces that custom methods are named according to `VerbNoun`, as 14 mandated in [AIP-136][]. 15 16 ## Details 17 18 This is difficult to enforce without a dictionary (likely not worth it), so 19 this rule just attempts to catch common, easy to spot errors. It complains if: 20 21 - The method name is one word. 22 23 ## Examples 24 25 ### Single word method 26 27 **Incorrect** code for this rule: 28 29 ```proto 30 // Incorrect. 31 rpc Checkout(CheckoutRequest) returns (CheckoutResponse) { // No noun. 32 option (google.api.http) = { 33 post: "/v1/{name=publishers/*/books/*}:checkout" 34 body: "*" 35 }; 36 } 37 ``` 38 39 **Correct** code for this rule: 40 41 ```proto 42 // Correct. 43 rpc CheckoutBook(CheckoutBookRequest) returns (CheckoutBookResponse) { 44 option (google.api.http) = { 45 post: "/v1/{name=publishers/*/books/*}:checkout" 46 body: "*" 47 }; 48 } 49 ``` 50 51 ## Disabling 52 53 If you need to violate this rule, use a leading comment above the method. 54 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 55 56 ```proto 57 // (-- api-linter: core::0136::verb-noun=disabled 58 // aip.dev/not-precedent: We need to do this because reasons. --) 59 rpc Checkout(CheckoutRequest) returns (CheckoutResponse) { 60 option (google.api.http) = { 61 post: "/v1/{name=publishers/*/books/*}:checkout" 62 body: "*" 63 }; 64 } 65 ``` 66 67 If you need to violate this rule for an entire file, place the comment at the 68 top of the file. 69 70 [aip-136]: https://aip.dev/136 71 [aip.dev/not-precedent]: https://aip.dev/not-precedent