github.com/googleapis/api-linter@v1.65.2/docs/rules/0127/uri-leading-slash.md (about)

     1  ---
     2  rule:
     3    aip: 127
     4    name: [core, '0127', uri-leading-slash]
     5    summary: URIs should always begin with a leading slash.
     6  permalink: /127/uri-leading-slash
     7  redirect_from:
     8    - /0127/uri-leading-slash
     9  ---
    10  
    11  # URI Forward Slashes
    12  
    13  This rule enforces that URIs must begin with a forward slash, as mandated in
    14  [AIP-127][].
    15  
    16  ## Details
    17  
    18  This rule scans all methods and complains if it finds a URI that does not start
    19  with `/`.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  rpc GetBook(GetBookRequest) returns (Book) {
    28    option (google.api.http) = {
    29      // Should be /v1/{name=publishers/*/books/*}
    30      get: "v1/{name=publishers/*/books/*}"
    31    };
    32  }
    33  ```
    34  
    35  **Correct** code for this rule:
    36  
    37  ```proto
    38  // Correct.
    39  rpc GetBook(GetBookRequest) returns (Book) {
    40    option (google.api.http) = {
    41      get: "/v1/{name=publishers/*/books/*}"
    42    };
    43  }
    44  ```
    45  
    46  ## Disabling
    47  
    48  Do not violate this rule. This would create an invalid URL.
    49  
    50  [aip-127]: https://aip.dev/127