@@ -214,19 +214,16 @@ When defining a method that retrieves or acts on an already-existing resource
214214(such as `GetBook` or `ArchiveBook`), the first field of the request message
215215**should** be the resource path, which **must** be of type `string` and
216216**must** be called `path` for the resource path. The field **should** also be
217- annotated with the `google.api.resource_reference` annotation, referencing the
218- resource type (AEP-4).
217+ annotated with `api.api.field_info`, referencing the resource type (AEP-4).
219218
220219```proto
221220// Request message for ArchiveBook
222221message ArchiveBookRequest {
223222// The book to archive.
224223// Format: publishers/{publisher_id}/books/{book_id}
225224string path = 1 [
226- (google.api.field_behavior) = REQUIRED,
227- (google.api.resource_reference) = {
228- type: "apis.example.com/library/Book"
229- }];
225+ (aep.api.field_info) = { resource_reference: [ "apis.example.com/library/Book" ], field_behavior: [ FIELD_BEHAVIOR_REQUIRED ] }
226+ ];
230227
231228// Other fields...
232229}
@@ -242,25 +239,23 @@ When defining a method that retrieves resources from a collection or adds a new
242239resource to a collection (such as `ListBooks` or `CreateBook`), the first field
243240of the request message **should** be of type `string` and **should** be called
244241`parent` for the resource path of the collection. The `parent` field **should**
245- also be annotated with the `google .api.resource_reference` annotation,
246- referencing the parent's resource type (AEP-4).
242+ also be annotated with `api .api.field_info`, referencing the parent's resource
243+ type (AEP-4).
247244
248245```proto
249246// Request message for ListBooks.
250247message ListBooksRequest {
251248// The publisher to list books from.
252249// Format: publishers/{publisher_id}
253- string parent = 1 [(google.api.resource_reference) = {
254- type: "apis.example.com/library/Publisher"
255- }];
250+ string parent = 1 [(aep.api.field_info) = { resource_reference: [ "apis.example.com/library/Publisher" ], field_behavior: [ FIELD_BEHAVIOR_REQUIRED ] }];
256251
257252// Other fields (e.g. max_page_size, page_token, filter, etc.)...
258253}
259254```
260255
261256If there is more than one possible parent type, the `parent` field **should**
262- be annotated with the `child_type` key on `google.api.resource_reference`
263- instead :
257+ be annotated with multiple `resource_reference` types using
258+ `aep.api.field_info` :
264259
265260```proto
266261// Request message for ListBooks.
@@ -270,10 +265,8 @@ message ListBooksRequest {
270265// - publishers/{publisher_id}
271266// - authors/{author_id}
272267string parent = 1 [
273- (google.api.field_behavior) = REQUIRED,
274- (google.api.resource_reference) = {
275- child_type: "apis.example.com/library/Book"
276- }];
268+ (aep.api.field_info) = { resource_reference: [ "apis.example.com/library/Book" ], field_behavior: [ FIELD_BEHAVIOR_REQUIRED ] }
269+ ];
277270
278271// Other fields (e.g. max_page_size, page_token, filter, etc.)...
279272}
@@ -298,8 +291,7 @@ When referencing a resource path for a different resource:
298291- Field names **should not** use the `_path` suffix unless the field would be
299292 ambiguous without it (e.g., `crypto_key_path`)
300293- In protobuf, fields representing another resource **should** provide the
301- `google.api.resource_reference` annotation with the resource type being
302- referenced.
294+ `aep.api.field_info` annotation with the resource type being referenced.
303295
304296```proto
305297// A representation of a book in a library.
@@ -315,9 +307,7 @@ string path = 1;
315307
316308// The shelf where the book currently sits.
317309// Format is `shelves/{shelf}`.
318- string shelf = 2 [(google.api.resource_reference) = {
319- type: "apis.example.com/library/Shelf"
320- }];
310+ string shelf = 2 [(aep.api.field_info) = { resource_reference: [ "apis.example.com/library/Shelf" ], field_behavior: [ FIELD_BEHAVIOR_REQUIRED ] }];
321311
322312// Other fields...
323313}
0 commit comments