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

     1  ---
     2  rule:
     3    aip: 132
     4    name: [core, '0132', method-signature]
     5    summary: |
     6      List RPCs should annotate a method signature of "parent".
     7  permalink: /132/method-signature
     8  redirect_from:
     9    - /0132/method-signature
    10  ---
    11  
    12  # List methods: Method signature
    13  
    14  This rule enforces that all `List` standard methods have a
    15  `google.api.method_signature` annotation with a value of `"parent"`, as
    16  mandated in [AIP-132][].
    17  
    18  ## Details
    19  
    20  This rule looks at any method beginning with `List`, and complains if the
    21  `google.api.method_signature` annotation is missing, or if it is set to any
    22  value other than `"parent"`. 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 ListBooks(ListBooksRequest) returns (Book) {
    32    // A google.api.method_signature annotation should be present.
    33  }
    34  ```
    35  
    36  ```proto
    37  // Incorrect.
    38  rpc ListBooks(ListBooksRequest) returns (Book) {
    39    option (google.api.method_signature) = "publisher";  // Should be "parent".
    40  }
    41  ```
    42  
    43  **Correct** code for this rule:
    44  
    45  ```proto
    46  // Correct.
    47  rpc ListBooks(ListBooksRequest) returns (Book) {
    48    option (google.api.method_signature) = "parent";
    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::0132::method-signature=disabled
    59  //     aip.dev/not-precedent: We need to do this because reasons. --)
    60  rpc ListBooks(ListBooksRequest) returns (Book);
    61  ```
    62  
    63  If you need to violate this rule for an entire file, place the comment at the
    64  top of the file.
    65  
    66  [aip-132]: https://aip.dev/132
    67  [aip.dev/not-precedent]: https://aip.dev/not-precedent