Allow HTTP POST calls for any showcase PATCH RPCs #1261
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
I'm trying to add in the showcase compliance test suite for Java and I'm running into an issue with the PATCH calls.
Error:
Java Gax-httpjson's module sends PATCH requests as a POST request with a
x-http-method-override: PATCH
header, which results in a 400 Bad Request. Looking at the historical reasons for this:https://github.com/googleapis/gapic-generator-java/blob/c23f981e2ac3c573bed51e725dc7061551179400/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpRequestRunnable.java#L217-L226
I believe the mux router setup for bodyPatch to expect a PATCH request
gapic-showcase/server/genrest/genrest.go
Line 43 in b94ecfc
Possible fix (Thanks to Noah for pointing me here):
gapic-showcase/util/genrest/goviewcreator.go
Lines 292 to 294 in b94ecfc
so it would output
router.HandleFunc("/v1beta1/repeat:bodypatch", rest.HandleRepeatDataBodyPatch).Methods("PATCH", "POST")
Alternatives:
x-http-method-override
?The text was updated successfully, but these errors were encountered: