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