grpc-swift icon indicating copy to clipboard operation
grpc-swift copied to clipboard

Being able to deserialize Status from a raw payload

Open piotrkowalczuk opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe it.

Some gRPC services are hidden behind proxies that translate RESTful into gRPC like:

  • https://github.com/grpc-ecosystem/grpc-gateway
  • https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_http1_bridge_filter

Such a middleman can handle both application/json and application/x-protobuf. In the former case, however, the server would respond using application/x-protobuf as well. In such a scenario, it is necessary to deserialize the gRPC error message manually.

Describe the solution you'd like

Status could get additional constructor init<Bytes: SwiftProtobufContiguousBytes>(serializedBytes bytes: Bytes) in a similar fasion Go library does

piotrkowalczuk avatar Oct 03 '24 12:10 piotrkowalczuk