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

     1  ---
     2  rule:
     3    aip: 134
     4    name: [core, '0134', synonyms]
     5    summary: Update methods must be named starting with "Update".
     6  permalink: /134/synonyms
     7  redirect_from:
     8    - /0134/synonyms
     9  ---
    10  
    11  # Update methods: Synonym check
    12  
    13  This rule enforces that single-resource creation methods have names beginning
    14  with `Update`, as mandated in [AIP-134][].
    15  
    16  ## Details
    17  
    18  This rule looks at any message with names similar to `Update`, and suggests
    19  using `Update` instead. It complains if it sees the following synonyms:
    20  
    21  - Patch
    22  - Put
    23  - Set
    24  
    25  ## Examples
    26  
    27  **Incorrect** code for this rule:
    28  
    29  ```proto
    30  // Incorrect.
    31  rpc PatchBook(PatchBookRequest) returns (Book) {  // Should be `UpdateBook`.
    32    option (google.api.http) = {
    33      patch: "/v1/{book.name=publishers/*/books/*}"
    34      body: "book"
    35    };
    36  }
    37  ```
    38  
    39  **Correct** code for this rule:
    40  
    41  ```proto
    42  // Correct.
    43  rpc UpdateBook(UpdateBookRequest) returns (Book) {
    44    option (google.api.http) = {
    45      patch: "/v1/{book.name=publishers/*/books/*}"
    46      body: "book"
    47    };
    48  }
    49  ```
    50  
    51  ## Disabling
    52  
    53  If you need to violate this rule, use a leading comment above the method.
    54  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    55  
    56  ```proto
    57  // (-- api-linter: core::0134::synonyms=disabled
    58  //     aip.dev/not-precedent: We need to do this because reasons. --)
    59  rpc PatchBook(PatchBookRequest) returns (Book) {
    60    option (google.api.http) = {
    61      patch: "/v1/{book.name=publishers/*/books/*}"
    62      body: "book"
    63    };
    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-134]: https://aip.dev/134
    71  [aip.dev/not-precedent]: https://aip.dev/not-precedent