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

     1  ---
     2  rule:
     3    aip: 165
     4    name: [core, '0165', http-uri-suffix]
     5    summary: Purge methods must have the correct URI suffix
     6  permalink: /165/http-uri-suffix
     7  redirect_from:
     8    - /0165/http-uri-suffix
     9  ---
    10  
    11  # Purge methods: URI suffix
    12  
    13  This rule enforces that `Purge` methods include the `:purge` suffix
    14  in the REST URI, as mandated in [AIP-165][].
    15  
    16  ## Details
    17  
    18  This rule looks at any method whose name starts with `Purge`, and
    19  complains if the HTTP URI does not end with `:purge`.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  rpc PurgeBooks(PurgeBooksRequest) returns (google.longrunning.Operation) {
    28    option (google.api.http) = {
    29      post: "/v1/{parent=publishers/*}/books:delete"  // Should end with `:purge`
    30      body: "*"
    31    };
    32    option (google.longrunning.operation_info) = {
    33      response_type: "PurgeBooksResponse"
    34      metadata_type: "PurgeBooksMetadata"
    35    };
    36  }
    37  ```
    38  
    39  **Correct** code for this rule:
    40  
    41  ```proto
    42  // Correct.
    43  rpc PurgeBooks(PurgeBooksRequest) returns (google.longrunning.Operation) {
    44    option (google.api.http) = {
    45      post: "/v1/{parent=publishers/*}/books:purge"
    46      body: "*"
    47    };
    48    option (google.longrunning.operation_info) = {
    49      response_type: "PurgeBooksResponse"
    50      metadata_type: "PurgeBooksMetadata"
    51    };
    52  }
    53  ```
    54  
    55  ## Disabling
    56  
    57  If you need to violate this rule, use a leading comment above the method.
    58  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    59  
    60  ```proto
    61  // (-- api-linter: core::0165::http-uri-suffix=disabled
    62  //     aip.dev/not-precedent: We need to do this because reasons. --)
    63  rpc PurgeBooks(PurgeBooksRequest) returns (google.longrunning.Operation) {
    64    option (google.api.http) = {
    65      post: "/v1/{parent=publishers/*}/books:delete"
    66      body: "*"
    67    };
    68    option (google.longrunning.operation_info) = {
    69      response_type: "PurgeBooksResponse"
    70      metadata_type: "PurgeBooksMetadata"
    71    };
    72  }
    73  ```
    74  
    75  If you need to violate this rule for an entire file, place the comment at the
    76  top of the file.
    77  
    78  [aip-165]: https://aip.dev/165
    79  [aip.dev/not-precedent]: https://aip.dev/not-precedent