File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,9 +137,28 @@ this case, services **may** use a `string`.
137137
138138### URIs
139139
140- Field names representing URLs or URIs ** should** always use ` uri ` rather than
141- ` url ` . This is because while all URLs are URIs, not all URIs are URLs. Field
142- names ** may** use a prefix in front of ` uri ` as appropriate.
140+ Field names representing arbitrary URIs ** should** use ` uri ` . In particular,
141+ note that URLs are URIs but not all URIs are URLs.
142+
143+ Field names ** may** use a prefix in front of ` uri ` as appropriate.
144+
145+ Field names that can only represent a URL ** should** use ` url ` .
146+
147+ ``` proto
148+ message Book {
149+ string name = 1 [(google.api.field_behavior) = IDENTIFIER];
150+
151+ // A URL pointing to an image of the book.
152+ string image_url = 2;
153+
154+ // A URI identifying the book.
155+ // This could be an ISBN or a URL.
156+ string uri = 3;
157+ }
158+ ```
159+
160+ ** Note:** APIs that have previously used ` uri ` for URL fields may continue to
161+ do so to avoid unnecessary API changes and to preserve local consistency.
143162
144163### Reserved words
145164
You can’t perform that action at this time.
0 commit comments