github.com/googleapis/api-linter@v1.65.2/docs/rules/0231/request-message-name.md (about) 1 --- 2 rule: 3 aip: 231 4 name: [core, '0231', request-message-name] 5 summary: Batch Get methods must have standardized request message names. 6 permalink: /231/request-message-name 7 redirect_from: 8 - /0231/request-message-name 9 --- 10 11 # Batch Get methods: Request message 12 13 This rule enforces that all `BatchGet` RPCs have a request message name of 14 `BatchGet*Request`, as mandated in [AIP-231][]. 15 16 ## Details 17 18 This rule looks at any method beginning with `BatchGet`, and 19 complains if the name of the corresponding input message does not match the 20 name of the RPC with the suffix `Request` appended. 21 22 ## Examples 23 24 **Incorrect** code for this rule: 25 26 ```proto 27 // Incorrect. 28 // Method input should be "BatchGetBooksRequest" 29 rpc BatchGetBooks(GetBookRequest) returns (BatchGetBooksResponse) { 30 option (google.api.http) = { 31 get: "/v1/{parent=publishers/*}/books:batchGet" 32 }; 33 } 34 ``` 35 36 **Correct** code for this rule: 37 38 ```proto 39 // Correct. 40 rpc BatchGetBooks(BatchGetBooksRequest) returns (BatchGetBooksResponse) { 41 option (google.api.http) = { 42 get: "/v1/{parent=publishers/*}/books:batchGet" 43 }; 44 } 45 ``` 46 47 ## Disabling 48 49 If you need to violate this rule, use a leading comment above the method. 50 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 51 52 ```proto 53 // (-- api-linter: core::0231::request-message-name=disabled 54 // aip.dev/not-precedent: We need to do this because reasons. --) 55 rpc BatchGetBooks(GetBookRequest) returns (BatchGetBooksResponse) { 56 option (google.api.http) = { 57 get: "/v1/{parent=publishers/*}/books:batchGet" 58 }; 59 } 60 ``` 61 62 If you need to violate this rule for an entire file, place the comment at the 63 top of the file. 64 65 [aip-231]: https://aip.dev/231 66 [aip.dev/not-precedent]: https://aip.dev/not-precedent