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