github.com/googleapis/api-linter@v1.65.2/docs/rules/0135/request-required-fields.md (about) 1 --- 2 rule: 3 aip: 135 4 name: [core, '0135', request-required-fields] 5 summary: Delete RPCs must not have unexpected required fields in the request. 6 permalink: /135/request-required-fields 7 redirect_from: 8 - /0135/request-required-fields 9 --- 10 11 # Delete methods: Required fields 12 13 This rule enforces that all `Delete` standard methods do not have unexpected 14 required fields, as mandated in [AIP-135][]. 15 16 ## Details 17 18 This rule looks at any message matching `Delete*Request` and complains if it 19 comes across any required fields other than: 20 21 - `string name` ([AIP-135][]) 22 23 ## Examples 24 25 **Incorrect** code for this rule: 26 27 ```proto 28 // Incorrect. 29 message DeleteBookRequest { 30 string name = 1 [(google.api.field_behavior) = REQUIRED]; 31 // Non-standard required field. 32 bool allow_missing = 4 [(google.api.field_behavior) = REQUIRED]; 33 } 34 ``` 35 36 **Correct** code for this rule: 37 38 ```proto 39 // Correct. 40 message DeleteBookRequest { 41 string name = 1 [(google.api.field_behavior) = REQUIRED]; 42 bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; 43 } 44 ``` 45 46 ## Disabling 47 48 If you need to violate this rule, use a leading comment above the field. 49 Remember to also include an [aip.dev/not-precedent][] comment explaining why. 50 51 ```proto 52 message DeleteBookRequest { 53 string name = 1 [(google.api.field_behavior) = REQUIRED]; 54 // (-- api-linter: core::0135::request-required-fields=disabled 55 // aip.dev/not-precedent: We really need this field to be required because 56 // reasons. --) 57 bool allow_missing = 4 [(google.api.field_behavior) = REQUIRED]; 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-135]: https://aip.dev/135 65 [aip.dev/not-precedent]: https://aip.dev/not-precedent