github.com/googleapis/api-linter@v1.65.2/docs/rules/0135/method-signature.md (about)

     1  ---
     2  rule:
     3    aip: 135
     4    name: [core, '0135', method-signature]
     5    summary: |
     6      Delete RPCs should annotate a method signature of "name".
     7  permalink: /135/method-signature
     8  redirect_from:
     9    - /0135/method-signature
    10  ---
    11  
    12  # Delete methods: Method signature
    13  
    14  This rule enforces that all `Delete` standard methods have a
    15  `google.api.method_signature` annotation with a value of `"name"`, as mandated
    16  in [AIP-135][].
    17  
    18  ## Details
    19  
    20  This rule looks at any method beginning with `Delete`, and complains if the
    21  `google.api.method_signature` annotation is missing, or if it is set to any
    22  value other than `"name"`. Additional method signatures, if present, are
    23  ignored.
    24  
    25  ## Examples
    26  
    27  **Incorrect** code for this rule:
    28  
    29  ```proto
    30  // Incorrect.
    31  rpc DeleteBook(DeleteBookRequest) returns (google.protobuf.Empty) {
    32    // A google.api.method_signature annotation should be present.
    33  }
    34  ```
    35  
    36  ```proto
    37  // Incorrect.
    38  rpc DeleteBook(DeleteBookRequest) returns (google.protobuf.Empty) {
    39    option (google.api.method_signature) = "book";  // Should be "name".
    40  }
    41  ```
    42  
    43  **Correct** code for this rule:
    44  
    45  ```proto
    46  // Correct.
    47  rpc DeleteBook(DeleteBookRequest) returns (google.protobuf.Empty) {
    48    option (google.api.method_signature) = "name";
    49  }
    50  ```
    51  
    52  ## Disabling
    53  
    54  If you need to violate this rule, use a leading comment above the method.
    55  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    56  
    57  ```proto
    58  // (-- api-linter: core::0135::method-signature=disabled
    59  //     aip.dev/not-precedent: We need to do this because reasons. --)
    60  rpc DeleteBook(DeleteBookRequest) returns (google.protobuf.Empty) {
    61    option (google.api.method_signature) = "book";
    62  }
    63  ```
    64  
    65  If you need to violate this rule for an entire file, place the comment at the
    66  top of the file.
    67  
    68  [aip-135]: https://aip.dev/135
    69  [aip.dev/not-precedent]: https://aip.dev/not-precedent