aip-dev / google.aip.dev

API Improvement Proposals. https://aip.dev/
Other
1.08k stars 495 forks source link

No HTTP transcoding for batch get nested request objects? #1380

Open bell-db opened 3 months ago

bell-db commented 3 months ago

AIP-231 allows nested request objects if

a field besides the resource name needs to be different between different resources being requested.

message BatchGetBooksRequest {
  // The requests specifying the books to retrieve.
  // A maximum of 1000 books can be retrieved in a batch.
  repeated GetBookRequest requests = 2
    [(google.api.field_behavior) = REQUIRED];
}

The same AIP also says

There must not be a body key in the google.api.http annotation.

Can we infer that requests are filled with query parameters? However, there seems no HTTP transcoding for repeated messages in query params:

Note that fields which are mapped to URL query parameters must have a primitive type or a repeated primitive type or a non-repeated message type.