grpc-ecosystem / grpc-gateway

gRPC to JSON proxy generator following the gRPC HTTP spec
https://grpc-ecosystem.github.io/grpc-gateway/
BSD 3-Clause "New" or "Revised" License
18.09k stars 2.23k forks source link

Support using FieldMasks with GET requests #698

Open kibertoad opened 6 years ago

kibertoad commented 6 years ago

Some GET requests (e. g. search) benefit greatly from being able to distinguish between default (e. g. 0) and non-defined values, since searching by "name='John' && age = 0" is not the same as "name='John' && age = undefined". Since FieldMasks are a generally recommended approach for optional fields in gRPC, it would be super helpful if grpc-gateway would support that.

ivucica commented 6 years ago

While it's recommended to use proto3 (so your FR makes sense), have you tried using proto2 syntax to distinguish between default and undefined values?

johanbrandhorst commented 6 years ago

This is being worked on in #671

kibertoad commented 6 years ago

@johanbrandhorst Are you sure? There was explicit request to create a separate issue as implementation would have to be handled separately.

johanbrandhorst commented 6 years ago

How is your request different from that being implemented in #671? I apologize if I've misunderstood.

kibertoad commented 6 years ago

671 very explicitly handles specific case of "If a binding is mapped to PATCH [HTTP method]". This issue is about GET HTTP methods.

johanbrandhorst commented 6 years ago

Good spot, this'll have to be a separate PR then. Sorry for the misunderstanding.

kibertoad commented 6 years ago

@johanbrandhorst Could you please remove "duplicate" label then :)?

kibertoad commented 6 years ago

Ah, thanks, already done.

negativeOne1 commented 5 years ago

hey, just wanted to ask if there are any updates on this one? Could really use this feature.

johanbrandhorst commented 5 years ago

Be the change you want to see! What can I do to help you get this in?