Questions tagged [grpc-gateway]

68 questions
11
votes
2 answers

How to investigate/fix: ambiguous import: found package cloud.google.com/go/compute/metadata in multiple modules

When I do a go mod tidy (go v1.19), I am receiving the following error. I do see both packages in my go pkg directory. I assume that v1.6.1 is the most current version and is the one to keep. If this is true, how do I determine who is dragging in…
A Bit of Help
  • 1,368
  • 19
  • 36
8
votes
1 answer

Google gRPC Gateway : Overriding response fields?

I am currently working on creating a gRPC service that uses the gRPC gateway / HTTP reverse-proxy to also offer HTTP support. I would like to follow the common conventions of Google API design. The example I found in the Google API design guide…
A. Davidson
  • 397
  • 1
  • 4
  • 14
8
votes
3 answers

How to do a 302 redirect in grpc-gateway

I use grpc-gateway to host an HTTP server out of my proto definitions. It works great overall. However, for one special endpoint, instead of returning a value back, I want to do a 302 redirect to an image hosted in an s3. If you want to return an…
Umut Benzer
  • 3,476
  • 4
  • 36
  • 53
7
votes
1 answer

Can Protobuf Field Mask be applied to grpc only case?

Let's take this example from the official doc: // Updates a book. rpc UpdateBook(UpdateBookRequest) returns (Book) { // Update maps to HTTP PATCH. Resource name is mapped to a URL path. // Resource is contained in the HTTP request body. option…
Sergii Getman
  • 3,845
  • 5
  • 34
  • 50
6
votes
1 answer

How to implement gRPC gateway mux handler to handle multiple http methods

I have REST HTTP handlers implemented with gorilla/mux. I am trying to migrate them into gRPC. There are some handlers doing file upload and download. So, my client decided to implement those handlers in gRPC gateway. One of my mux handler handles…
nipuna
  • 3,697
  • 11
  • 24
6
votes
0 answers

Why does the Protobuf JavaScript compiler suffix collections with "List", "Map", etc?

Why does the protobuf JavaScript code generator suffix collections with the collection type? For example: repeated string names becomes obj.namesList map bar becomes obj.barMap And this is as per the documentation, here:…
David Wolever
  • 148,955
  • 89
  • 346
  • 502
5
votes
3 answers

How to run grpc-gateway for python

I am grpc rookie and wanted to create a REST endpoint for health check of the grpc server. For this I decided to use grpc gateway. However, the example in docs for grpc-REST gateway for proxying grpc to json are only given for Golang. But I have a…
Shivansh Jagga
  • 1,541
  • 1
  • 15
  • 24
4
votes
3 answers

What is the difference between grpc-gateway vs Twirp RPC

We already have the Twrip-RPC which provides rpc and rest endpoints . then why we need the grpc-Gateway . What advantages it's providing compared to twirp. Is it like we can provide custom endpoints with grpc gateway is that the only difference.…
user1844634
  • 1,221
  • 2
  • 17
  • 35
4
votes
1 answer

Not able to generating empty array/slice of golang code using protobuf

We want to return one object/struct with one property as empty list/array/slice in golang to client(browser). from the go code we are returning empty slice of len=0 and capacity=0, but through protobuf this key is getting deleted or set as a nil and…
dev2
  • 117
  • 2
  • 10
4
votes
1 answer

How to access request headers in grpc service proxied by. grpc-gateway in golang

I have a grpc server proxied by grpc-gateway. When I make a HTTP call to the gateway endpoint, my corresponding grpc service method is called. Now, the grpc service implementation receives a Context which has the headers. I couldn't figure out how…
Amudhan
  • 696
  • 8
  • 18
4
votes
2 answers

grpc-gateway endpoints priority order

I have a service defined this way : service Service { rpc SearchCategory(SearchCategoryRequest) returns (SearchCategoryResponse) { option (google.api.http) = { get: "/v1/categories/search" }; } rpc…
c4k
  • 4,270
  • 4
  • 40
  • 65
3
votes
3 answers

CORS grpc Gateway GoLang

I have a vue.js 3 frontend, and I am calling a Golang backend via grpc-gateway. I have been at this for a while but I see light at the end of the tunnel. I am currently facing a CORS issue. However, I am reading conflicting information on how to…
Mike3355
  • 11,305
  • 24
  • 96
  • 184
3
votes
1 answer

Why am i getting connection connection closed before server preface received in go?

I am trying to setup a rpc server and a proxy HTTP server over GRPC server on same port using grpc-gateway. Wierdly some times i am getting failed to receive server preface within timeout error randomly. Most of the times it happens on service…
Kshitij Singh
  • 83
  • 1
  • 1
  • 5
3
votes
0 answers

Custom URL Parameter in gRPC-Gateway Transcoding

for example, I have this kind of proto definition: service Greeter { rpc SayHello (HelloRequest) returns (HelloReply) { option (google.api.http) = { get: "/hello" }; } } message HelloRequest { repeated int32 ids = 1; …
dkiswanto
  • 192
  • 1
  • 2
  • 12
3
votes
1 answer

Why grpc-gateway generate string fields instead of int or float?

Everyone hello When I try generate protobuf with different fields in the message, it somehow generates string fields in the documentation instead of int or float I'll attach the protofile code and the structure code. service Payment { rpc…
midaef
  • 47
  • 6
1
2 3 4 5