Skip to content

Discovery samples: Ensure the last element of the Java import path is capitalized - #151

Open
vchudnov-g wants to merge 3 commits into
googleapis:masterfrom
vchudnov-g:iam-import
Open

Discovery samples: Ensure the last element of the Java import path is capitalized#151
vchudnov-g wants to merge 3 commits into
googleapis:masterfrom
vchudnov-g:iam-import

Conversation

@vchudnov-g

Copy link
Copy Markdown
Contributor

This was causing problems for IAM, since the Discovery file said "canonicalName" : "iam" and thus the import in the sample read import ....v1.iam; instead of import ....v1.Iam;

@vchudnov-g vchudnov-g added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jun 5, 2020
@vchudnov-g
vchudnov-g requested a review from vam-google June 5, 2020 22:51
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 5, 2020

@vam-google vam-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a comment

Joiner.on('.').join(packagePrefix, capitalize(apiTypeName)));
}

public static String capitalize(String str) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be public (maybe private is enough, I see it being used from getSErviceTypeName()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@vchudnov-g

Copy link
Copy Markdown
Contributor Author

Argh. Not fully fixed, it turns out. The references to the imported class are still lower-cased. I'll update this PR with a fix.

@vchudnov-g

Copy link
Copy Markdown
Contributor Author

Ok, that should be fixed now. I'll figure out how to add a test before I submit this.

@vam-google vam-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants