github.com/googleapis/api-linter@v1.65.2/docs/rules/0135/request-name-field.md (about)

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