-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
googleapis/gax-nodejs
#1320Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
There seems to be an error related to the update resource of google AIP.
As specified in AIP, update resource should be sent by patch method, and gax-nodejs is also supposed to send request to patch.
However, for window fetch https://fetch.spec.whatwg.org/#methods, as you can see here, patch is not allowed as the default specification.
So, I think it would be better to change it to uppercase ‘PATCH’ instead of lowercase ‘patch’, what do you think?
In fact, when I use this library in production it passes 400 Bad Requests. And when I fix the build to use the method with the name "PATCH" in local, got no errors.
Environment details
- OS: macOS 12.4
- Node.js version: v18.7.0
- npm version: v8.15.0
google-gaxversion: 2.30.4
Steps to reproduce
- create update resource service
// Updates an existing Resource And Returns the updated Resource.
rpc UpdateResource(UpdateResourceRequest) returns (Resource) {
option (google.api.http) = {
patch: "/api/v1/{resource.name=resources/*}"
body: "resource"
};
option (google.api.method_signature) = "resource,update_mask";
}- build it with google-gax
- use the service
const resourceService = new ResourceServiceClient({
auth: { getRequestHeaders: async () => ({ authorization: "Bearer abcd" }) },
fallback: 'rest',
protocol: 'https',
apiEndpoint: 'api.end.point',
port: 443,
});
await resourceService.updateResource(request);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.