Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure when generating functions v1 API #609

Open
alexander-fenster opened this issue Jul 17, 2020 · 3 comments
Open

Compilation failure when generating functions v1 API #609

alexander-fenster opened this issue Jul 17, 2020 · 3 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@alexander-fenster
Copy link
Contributor

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 alexander-fenster added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jul 17, 2020
@alexander-fenster alexander-fenster self-assigned this Jul 17, 2020
@JustinBeckwith
Copy link
Contributor

@alexander-fenster didn't this one get addressed?

@alexander-fenster
Copy link
Contributor Author

alexander-fenster commented Sep 2, 2020

@JustinBeckwith Not yet, but I'm on my way there (started with #682).

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Dec 1, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jan 13, 2021
@alexander-fenster alexander-fenster added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 28, 2021
@alexander-fenster
Copy link
Contributor Author

Downgrading to feature request since it's just one API that is affected, and this API violates the recommendations of AIP-140.

@alexander-fenster alexander-fenster removed their assignment Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants