Field names: URIs

This rule enforces that field names use uri rather than url, as mandated in AIP-140.


This rule checks every field in the proto and complains if the field name includes url. (It splits on _ to avoid false positives.)


Incorrect code for this rule:

// Incorrect.
message Book {
  string url = 1;  // Should be `uri`.

Correct code for this rule:

// Correct.
message Book {
  string uri = 1;


If you need to violate this rule, use a leading comment above the method. Remember to also include an comment explaining why.

// (-- api-linter: core::0140::uri=disabled
// We need to do this because reasons. --)
message Book {
  string url = 1;

If you need to violate this rule for an entire file, place the comment at the top of the file.