github.com/googleapis/api-linter@v1.65.2/docs/rules/0217/synonyms.md (about) 1 --- 2 rule: 3 aip: 217 4 name: [core, '0217', synonyms] 5 summary: The field for unreachable resources should be named `unreachable`. 6 permalink: /217/synonyms 7 redirect_from: 8 - /0217/synonyms 9 --- 10 11 # States 12 13 This rule enforces that the field describing unreachable resources in response 14 messages is named `unreachable` rather than `unreachable_locations`, as 15 mandated in [AIP-217][]. 16 17 ## Details 18 19 This rule iterates over paginated response messages and looks for a field named 20 `unreachable_locations`, and complains if it finds one, suggesting the use of 21 `unreachable` instead. 22 23 ## Examples 24 25 **Incorrect** code for this rule: 26 27 ```proto 28 // Incorrect. 29 message ListBooksResponse { 30 repeated Book books = 1; 31 string next_page_token = 2; 32 repeated string unreachable_locations = 3; 33 } 34 ``` 35 36 **Correct** code for this rule: 37 38 ```proto 39 // Correct. 40 message ListBooksResponse { 41 repeated Book books = 1; 42 string next_page_token = 2; 43 repeated string unreachable = 3; 44 } 45 ``` 46 47 ## Disabling 48 49 If you need to violate this rule, use a leading comment above the field. 50 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 51 52 ```proto 53 message ListBooksResponse { 54 repeated Book books = 1; 55 string next_page_token = 2; 56 // (-- api-linter: core::0217::synonyms=disabled 57 // aip.dev/not-precedent: We need to do this because reasons. --) 58 repeated string unreachable_locations = 3; 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-217]: https://aip.dev/217 66 [aip.dev/not-precedent]: https://aip.dev/not-precedent