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
17.96k stars 2.21k forks source link

Handling of optional parameters #697

Closed kibertoad closed 6 years ago

kibertoad commented 6 years ago

gRPC provides two mechanisms for handling optional parameters: Structs and FieldMasks. I couldn't find anywhere in documentation whether either of them are used for attributes that are specified as non-mandatory in Swagger. There doesn't seem to be any examples either.

Two main use-cases for this are PATCH and get?attrName=attrValue (find) operations, where you definitely want to distinguish between defined and undefined values, since searching by "name='John' && age = 0" is not the same as "name='John' && age = undefined"

kibertoad commented 6 years ago

This https://github.com/grpc-ecosystem/grpc-gateway/issues/379 is related, but PATCH is only part of the story here :)

kibertoad commented 6 years ago

Created #698 for GET and now I guess this one is redundant.