gapic-generator-typescript
gapic-generator-typescript copied to clipboard
Compilation failure when generating functions v1 API
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 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 --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_,
});
}
@alexander-fenster didn't this one get addressed?
@JustinBeckwith Not yet, but I'm on my way there (started with #682).
Downgrading to feature request since it's just one API that is affected, and this API violates the recommendations of AIP-140.