grpc-ecosystem / grpc-ecosystem/grpc-httpjson-transcoding

Is map in query param supported?

Open
#37 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
178
Forks
39
PR merge metrics
No merged PRs in 30d

Description

In my use case my `GetSomethingRequest` includes a `map`, and I didn't manage to pass the map as a query param. So I have to attach a body to the `GET` request which is bad. This is how I define the messages and service:

```proto
message Key {
map data = 1;
string field = 2;
}
message GetSomethingRequest {
string parent = 1;
Key key = 2;
}
service SomeService {
rpc GetSomething(GetSomethingRequest) returns (Something) {
option (google.api.http) = {
get: "/v1/parent/{parent}/somethings"
};
}
}
```

I tried the following and neither of them works.

```
// also tried to replace [, ], {, }, :, = with percent encode.
// the first two are following https://github.com/grpc-ecosystem/grpc-gateway/pull/535
GET /v1/parent/parentname/somethings?field=aa&data[abc]=cba
GET /v1/parent/parentname/somethings?key.field=aa&key.data[abc]=cba
GET /v1/parent/parentname/somethings?key.field=aa&key.data={abc:cba}
```

So I wonder if map of primitives as query param is supported? If not any plans to add support for this? Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.