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

use sdkId if available for service client generation #276

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

kggilmer
Copy link
Contributor

Use settings property to retrieve sdk id or service name. Fixes #236.

Issue #, if available: #236

Description of changes:

  • Use existing property to read sdkId and fall back to service name if unavailable.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kggilmer kggilmer requested a review from aajtodd April 15, 2021 16:11
Copy link
Contributor

@aajtodd aajtodd left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -125,7 +125,7 @@ class ServiceGenerator(private val ctx: RenderingContext<ServiceShape>) {
writer.write("")
.write("override val serviceName: String")
.indent()
.write("get() = \"#L\"", service.id.name)
.write("get() = \"#L\"", ctx.settings.sdkId)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

this could be updated to just #S instead of a manual escape (I'm guessing I didn't know about the S format specifier when this was originally written).

@kggilmer kggilmer merged commit 0b87b84 into main Apr 16, 2021
@kggilmer kggilmer deleted the fix-servicename-sdkid branch April 16, 2021 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sdkId not respected when generating service client interface
2 participants