github.com/googleapis/api-linter@v1.65.2/docs/rules/0162/rollback-http-uri-suffix.md (about)

     1  ---
     2  rule:
     3    aip: 162
     4    name: [core, '0162', rollback-http-uri-suffix]
     5    summary: Rollback methods must have the correct URI suffix
     6  permalink: /162/rollback-http-uri-suffix
     7  redirect_from:
     8    - /0162/rollback-http-uri-suffix
     9  ---
    10  
    11  # Rollback methods: URI suffix
    12  
    13  This rule enforces that `Rollback` methods include the `:rollback` suffix
    14  in the REST URI, as mandated in [AIP-162][].
    15  
    16  ## Details
    17  
    18  This rule looks at any method beginning with `Rollback`, and
    19  complains if the HTTP URI does not end with `:rollback`.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  rpc RollbackBook(RollbackBookRequest) returns (Book) {
    28    option (google.api.http) = {
    29      post: "/v1/{name=publishers/*/books/*}:undo"  // Should end with `:rollback`
    30      body: "*"
    31    };
    32  }
    33  ```
    34  
    35  **Correct** code for this rule:
    36  
    37  ```proto
    38  // Correct.
    39  rpc RollbackBook(RollbackBookRequest) returns (Book) {
    40    option (google.api.http) = {
    41      post: "/v1/{name=publishers/*/books/*}:rollback"
    42      body: "*"
    43    };
    44  }
    45  ```
    46  
    47  ## Disabling
    48  
    49  If you need to violate this rule, use a leading comment above the method.
    50  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    51  
    52  ```proto
    53  // (-- api-linter: core::0162::rollback-http-uri-suffix=disabled
    54  //     aip.dev/not-precedent: We need to do this because reasons. --)
    55  rpc RollbackBook(RollbackBookRequest) returns (Book) {
    56    option (google.api.http) = {
    57      post: "/v1/{name=publishers/*/books/*}:undo"
    58      body: "*"
    59    };
    60  }
    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-162]: https://aip.dev/162
    67  [aip.dev/not-precedent]: https://aip.dev/not-precedent