googleapis / googleapis/google-cloud-node
Compilation failure when generating functions v1 API
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
```sh
bazel build //google/cloud/functions/v1:functions-v1-nodejs
```
Compilation failure:
```
...
src/v1/cloud_functions_service_client.ts:1333:52 - error TS1138: Parameter declaration expected.
1333 cloudFunctionPath(project:string,location:string,function:string) {
~~~~~~~~
... (many more)
```
The API violates [AIP-140](https://google.aip.dev/140) by having a field named `function`. We can replace the known reserved words in the generated code. The following diff fixes the generated library:
```diff
diff --git a/src/v1/cloud_functions_service_client.ts.orig b/src/v1/cloud_functions_service_client.ts
index ba5d582..ce7bc85 100644
--- a/src/v1/cloud_functions_service_client.ts.orig
+++ b/src/v1/cloud_functions_service_client.ts
@@ -1330,11 +1330,11 @@ export class CloudFunctionsServiceClient {
* @param {string} function
* @returns {string} Resource name string.
*/
- cloudFunctionPath(project:string,location:string,function:string) {
+ cloudFunctionPath(project:string,location:string,function_:string) {
return this.pathTemplates.cloudFunctionPathTemplate.render({
project: project,
location: location,
- function: function,
+ function: function_,
});
}
```
Contributor guide
Assessment
This issue has not been assessed yet.