github.com/googleapis/api-linter@v1.65.2/docs/rules/0133/request-message-name.md (about)

     1  ---
     2  rule:
     3    aip: 133
     4    name: [core, '0133', request-message-name]
     5    summary: Create methods must have standardized request message names.
     6  permalink: /133/request-message-name
     7  redirect_from:
     8    - /0133/request-message-name
     9  ---
    10  
    11  # Create methods: Request message
    12  
    13  This rule enforces that all `Create` RPCs have a request message name of
    14  `Create*Request`, as mandated in [AIP-133][].
    15  
    16  ## Details
    17  
    18  This rule looks at any message matching beginning with `Create`, and complains
    19  if the name of the corresponding input message does not match the name of the
    20  RPC with the suffix `Request` appended.
    21  
    22  ## Examples
    23  
    24  **Incorrect** code for this rule:
    25  
    26  ```proto
    27  // Incorrect.
    28  rpc CreateBook(Book) returns (Book) {  // Should be `CreateBookRequest`.
    29    option (google.api.http) = {
    30      post: "/v1/{parent=publishers/*}/books"
    31      body: "*"
    32    };
    33  }
    34  ```
    35  
    36  **Correct** code for this rule:
    37  
    38  ```proto
    39  // Correct.
    40  rpc CreateBook(CreateBookRequest) returns (Book) {
    41    option (google.api.http) = {
    42      post: "/v1/{parent=publishers/*}/books"
    43      body: "book"
    44    };
    45  }
    46  ```
    47  
    48  ## Disabling
    49  
    50  If you need to violate this rule, use a leading comment above the method.
    51  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    52  
    53  ```proto
    54  // (-- api-linter: core::0133::request-message-name=disabled
    55  //     aip.dev/not-precedent: We need to do this because reasons. --)
    56  rpc CreateBook(Book) returns (Book) {
    57    option (google.api.http) = {
    58      post: "/v1/{parent=publishers/*}/books"
    59      body: "*"
    60    };
    61  }
    62  ```
    63  
    64  If you need to violate this rule for an entire file, place the comment at the
    65  top of the file.
    66  
    67  [aip-133]: https://aip.dev/133
    68  [aip.dev/not-precedent]: https://aip.dev/not-precedent