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

     1  ---
     2  rule:
     3    aip: 163
     4    name: [core, '0163', synonyms]
     5    summary: Change validation fields should be named `validate_only`.
     6  permalink: /163/synonyms
     7  redirect_from:
     8    - /0163/synonyms
     9  ---
    10  
    11  # Synonyms
    12  
    13  This rule enforces that the `validate_only` field is named `validate_only`, and
    14  not a common synonym, as mandated in [AIP-163][].
    15  
    16  ## Details
    17  
    18  This rule complains if it encounters a known synonym to `validate_only`.
    19  Currently, the only recognized synonym `dry_run`.
    20  
    21  ## Examples
    22  
    23  **Incorrect** code for this rule:
    24  
    25  ```proto
    26  // Incorrect.
    27  message CreateBookRequest {
    28    string parent = 1;
    29    Book book = 2;
    30    bool dry_run = 3;  // Should be `validate_only`.
    31  }
    32  ```
    33  
    34  **Correct** code for this rule:
    35  
    36  ```proto
    37  // Correct.
    38  message CreateBookRequest {
    39    string parent = 1;
    40    Book book = 2;
    41    bool validate_only = 3;
    42  }
    43  ```
    44  
    45  ## Disabling
    46  
    47  If you need to violate this rule, use a leading comment above the field.
    48  Remember to also include an [aip.dev/not-precedent][] comment explaining why.
    49  
    50  ```proto
    51  message CreateBookRequest {
    52    string parent = 1;
    53    Book book = 2;
    54    // (-- api-linter: core::0163::synonyms=disabled
    55    //     aip.dev/not-precedent: We need to do this because reasons. --)
    56    bool dry_run = 3;
    57  }
    58  ```
    59  
    60  If you need to violate this rule for an entire file, place the comment at the
    61  top of the file.
    62  
    63  [aip-163]: https://aip.dev/163
    64  [aip.dev/not-precedent]: https://aip.dev/not-precedent