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

     1  ---
     2  rule:
     3    aip: 164
     4    name: [core, '0164', request-unknown-fields]
     5    summary: Undelete RPCs should not have unexpected fields in the request.
     6  permalink: /164/request-unknown-fields
     7  redirect_from:
     8    - /0164/request-unknown-fields
     9  ---
    10  
    11  # Undelete methods: Unknown fields
    12  
    13  This rule enforces that all `Undelete` requests do not have unexpected
    14  fields, as mandated in [AIP-164][].
    15  
    16  ## Details
    17  
    18  This rule looks at any message matching `Undelete*Request` and complains if it
    19  comes across any fields other than:
    20  
    21  - `string name` ([AIP-164][])
    22  - `string etag` ([AIP-154][])
    23  - `string request_id` ([AIP-155][])
    24  - `bool validate_only` ([AIP-163][])
    25  
    26  ## Examples
    27  
    28  **Incorrect** code for this rule:
    29  
    30  ```proto
    31  // Incorrect.
    32  message UndeleteBookRequest {
    33    string name = 1 [
    34      (google.api.field_behavior) = REQUIRED,
    35      (google.api.resource_reference).type = "library.googleapis.com/Book",
    36    ];
    37    string library_id = 2;  // Non-standard field.
    38  }
    39  ```
    40  
    41  **Correct** code for this rule:
    42  
    43  ```proto
    44  // Correct.
    45  message UndeleteBookRequest {
    46    string name = 1 [
    47      (google.api.field_behavior) = REQUIRED,
    48      (google.api.resource_reference).type = "library.googleapis.com/Book",
    49    ];
    50  }
    51  ```
    52  
    53  ## Disabling
    54  
    55  If you need to violate this rule, use a leading comment above the field.
    56  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    57  
    58  ```proto
    59  message UndeleteBookRequest {
    60    string name = 1 [
    61      (google.api.field_behavior) = REQUIRED,
    62      (google.api.resource_reference).type = "library.googleapis.com/Book",
    63    ];
    64  
    65    // (-- api-linter: core::0164::request-unknown-fields=disabled
    66    //     aip.dev/not-precedent: We really need this field because reasons. --)
    67    string library_id = 2;
    68  }
    69  ```
    70  
    71  If you need to violate this rule for an entire file, place the comment at the
    72  top of the file.
    73  
    74  [aip-154]: https://aip.dev/154
    75  [aip-155]: https://aip.dev/155
    76  [aip-163]: https://aip.dev/163
    77  [aip-164]: https://aip.dev/164
    78  [aip.dev/not-precedent]: https://aip.dev/not-precedent