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

     1  ---
     2  rule:
     3    aip: 135
     4    name: [core, '0135', request-force-field]
     5    summary: Delete request `force` fields must have type `bool`.
     6  permalink: /135/request-force-field
     7  redirect_from:
     8    - /0135/request-force-field
     9  ---
    10  
    11  # Delete requests: force field
    12  
    13  This rule enforces that all `Delete` request `force` fields have type `bool`, as
    14  mandated in [AIP-135][].
    15  
    16  ## Details
    17  
    18  This rule looks at any message matching `Delete*Request` that contains a `force`
    19  field and complains if the field is not a singular `bool`.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  message DeletePublisherRequest {
    27    string name = 1 [
    28      (google.api.resource_reference).type = "library.googleapis.com/Publisher",
    29      (google.api.field_behavior) = REQUIRED
    30    ];
    31  
    32    int32 force = 2;  // Field type should be `bool`.
    33  }
    34  ```
    35  
    36  **Correct** code for this rule:
    37  
    38  ```proto
    39  message DeletePublisherRequest {
    40    string name = 1 [
    41      (google.api.resource_reference).type = "library.googleapis.com/Publisher",
    42      (google.api.field_behavior) = REQUIRED
    43    ];
    44  
    45    bool force = 2;
    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 DeletePublisherRequest {
    56    string name = 1 [
    57      (google.api.resource_reference).type = "library.googleapis.com/Publisher",
    58      (google.api.field_behavior) = REQUIRED
    59    ];
    60  
    61    // (-- api-linter: core::0135::request-force-field=disabled
    62    //     aip.dev/not-precedent: We need to do this because reasons. --)
    63    int32 force = 2;
    64  }
    65  ```
    66  
    67  If you need to violate this rule for an entire file, place the comment at the
    68  top of the file.
    69  
    70  [aip-135]: https://aip.dev/135
    71  [aip.dev/not-precedent]: https://aip.dev/not-precedent