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

     1  ---
     2  rule:
     3    aip: 135
     4    name: [core, '0135', request-unknown-fields]
     5    summary: Delete RPCs should not have unexpected fields in the request.
     6  permalink: /135/request-unknown-fields
     7  redirect_from:
     8    - /0135/request-unknown-fields
     9  ---
    10  
    11  # Delete methods: Unknown fields
    12  
    13  This rule enforces that all `Delete` standard methods do not have unexpected
    14  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 fields other than:
    20  
    21  - `string name` ([AIP-135][])
    22  - `bool allow_missing` ([AIP-135][])
    23  - `bool force` ([AIP-135][])
    24  - `string etag` ([AIP-154][])
    25  - `string request_id` ([AIP-155][])
    26  - `bool validate_only` ([AIP-163][])
    27  
    28  ## Examples
    29  
    30  **Incorrect** code for this rule:
    31  
    32  ```proto
    33  // Incorrect.
    34  message DeleteBookRequest {
    35    string name = 1;
    36    string library_id = 2;  // Non-standard field.
    37  }
    38  ```
    39  
    40  **Correct** code for this rule:
    41  
    42  ```proto
    43  // Correct.
    44  message DeleteBookRequest {
    45    string name = 1;
    46  }
    47  ```
    48  
    49  ## Disabling
    50  
    51  If you need to violate this rule, use a leading comment above the field.
    52  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    53  
    54  ```proto
    55  message DeleteBookRequest {
    56    string name = 1;
    57  
    58    // (-- api-linter: core::0135::request-unknown-fields=disabled
    59    //     aip.dev/not-precedent: We really need this field because reasons. --)
    60    string library_id = 2;
    61  }
    62  ```
    63  
    64  If you need to violate this rule for an entire file, place the comment at the
    65  top of the file.
    66  
    67  [aip-135]: https://aip.dev/135
    68  [aip-154]: https://aip.dev/154
    69  [aip-155]: https://aip.dev/155
    70  [aip-163]: https://aip.dev/163
    71  [aip.dev/not-precedent]: https://aip.dev/not-precedent