Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions aip/general/0140.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,29 @@ this case, services **may** use a `string`.

### URIs

Field names representing URLs or URIs **should** always use `uri` rather than
`url`. This is because while all URLs are URIs, not all URIs are URLs. Field
names **may** use a prefix in front of `uri` as appropriate.
Field names representing arbitrary URIs **should** use `uri`. In particular,
note that URLs are URIs but not all URIs are URLs.

Field names **may** use a prefix in front of `uri` as appropriate.

Field names that can only represent a URL **should** use `url`.

```proto
message Book {
string name = 1 [(google.api.field_behavior) = IDENTIFIER];

// A URL pointing to an image of the book.
string image_url = 2;

// A URI identifying the book.
// This could be an ISBN or a URL.
string uri = 3;
}
```

**Note:**
APIs that have previously used `uri` for URL fields may continue to do so
Comment thread
stephanemoore marked this conversation as resolved.
Outdated
to avoid unnecessary API changes and to preserve local consistency.

### Reserved words

Expand Down