fix: regapic support for proto wkt in query params#1124
fix: regapic support for proto wkt in query params#1124noahdietz merged 10 commits intogoogleapis:mainfrom
Conversation
| } | ||
| b.WriteString("}\n") | ||
| b.WriteString(fmt.Sprintf("params.Add(%q, string(%s))", lowerFirst(snakeToCamel(path)), field.GetJsonName())) | ||
| paramAdd = b.String() |
There was a problem hiding this comment.
So you're overwriting the parmAdd from above, line 424? What about registering the fmt import in line 423? Is that still valid? I know Go style tries to avoid elses, but given the non-trivial processing in both branches I think it might be clearer to organize this as
if wellKnownType {
…
} else {
…
}
There was a problem hiding this comment.
Good point about the fmt import, I need to conditionally include that.
I'm not sure I understand the scope of your "if/else" comment though. Do you just mean WRT when to import fmt? If so, yeah that is what I plan to do :)
There was a problem hiding this comment.
Yeah, that's exactly what I meant. Thanks!
…into regapic-wkt
… into regapic-wkt
vchudnov-g
left a comment
There was a problem hiding this comment.
Looks great. Thanks for doing this!
| } | ||
| b.WriteString("}\n") | ||
| b.WriteString(fmt.Sprintf("params.Add(%q, string(%s))", lowerFirst(snakeToCamel(path)), field.GetJsonName())) | ||
| paramAdd = b.String() |
There was a problem hiding this comment.
Yeah, that's exactly what I meant. Thanks!
Properly handle protobuf well known message types that have special JSON mappings e.g.
google.protobuf.FieldMaskwhen they appear as query parameters.The list of well known types is defined here: https://developers.google.com/protocol-buffers/docs/proto3#json
Update gapic-showcase to v0.25.0 that exercises this code, and update the Identity service tests to run against REST as well, to exercise the FieldMask encoding.