File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,8 @@ example: `file_path`).
237237
238238### Fields representing a resource's parent
239239
240+ {% tab proto %}
241+
240242When defining a method that retrieves resources from a collection or adds a new
241243resource to a collection (such as `ListBooks` or `CreateBook`), the first field
242244of the request message **should** be of type `string` and **should** be called
@@ -281,6 +283,21 @@ string parent = 1 [
281283**Note:** Fields **should not** be called `parent` except for this purpose. For
282284other use cases, use a synonymous term if possible.
283285
286+ {% tab oas %}
287+
288+ For HTTP APIs, the parent is determined from the HTTP path of the resource. For
289+ example, for the following book:
290+
291+ ```
292+ http://api.example.com/publishers/123/books/les-miserables
293+ ```
294+
295+ `publishers/123` is the parent resource. For any use cases in which the parent
296+ is needed, they may be extracted from the HTTP path by removing the collection
297+ and id suffix of the path (`books/les-miserables`) in the case above.
298+
299+ {% endtabs %}
300+
284301### Fields representing another resource
285302
286303When referencing a resource path for a different resource, the field **should**
You can’t perform that action at this time.
0 commit comments