github.com/googleapis/api-linter@v1.65.2/docs/rules/0134/request-mask-required.md (about)

     1  ---
     2  rule:
     3    aip: 134
     4    name: [core, '0134', request-mask-required]
     5    summary: Update RPCs must have a field mask in the request.
     6  permalink: /134/request-mask-required
     7  redirect_from:
     8    - /0134/request-mask-required
     9  ---
    10  
    11  # Update methods: Mask field
    12  
    13  This rule enforces that all `Update` standard methods have a field in the
    14  request message for the field mask, as mandated in [AIP-134][].
    15  
    16  ## Details
    17  
    18  This rule looks at any message matching `Update*Request` and complains if it
    19  can not find a field named `update_mask`.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  // `google.protobuf.FieldMask update_mask` is missing.
    28  message UpdateBookRequest {
    29    Book book = 1;
    30  }
    31  ```
    32  
    33  
    34  **Correct** code for this rule:
    35  
    36  ```proto
    37  // Correct.
    38  message UpdateBookRequest {
    39    Book book = 1;
    40    google.protobuf.FieldMask update_mask = 2;
    41  }
    42  ```
    43  
    44  ## Disabling
    45  
    46  If you need to violate this rule, use a leading comment above the message.
    47  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    48  
    49  ```proto
    50  // (-- api-linter: core::0134::request-mask-required=disabled
    51  //     aip.dev/not-precedent: We need to do this because reasons. --)
    52  message UpdateBookRequest {
    53    Book book = 1;
    54  }
    55  ```
    56  
    57  If you need to violate this rule for an entire file, place the comment at the
    58  top of the file.
    59  
    60  [aip-134]: https://aip.dev/134
    61  [aip.dev/not-precedent]: https://aip.dev/not-precedent