-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix smithy sdk no default client #564
Conversation
@@ -72,7 +73,7 @@ class ServiceGenerator(private val ctx: RenderingContext<ServiceShape>) { | |||
SectionServiceCompanionObject, | |||
context = mapOf(SectionServiceCompanionObject.ServiceSymbol to serviceSymbol) | |||
) { | |||
renderCompanionObject() | |||
renderCompanionObject(ctx.protocolGenerator != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style
ctx
is a property on the class, no real reason to thread through the parameter
withBlock("operator fun invoke(block: Config.Builder.() -> Unit = {}): ${serviceSymbol.name} {", "}") { | ||
write("val config = Config.Builder().apply(block).build()") | ||
write("return Default${serviceSymbol.name}(config)") | ||
this.callIf(hasProtocolGenerator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit/style does this
need qualified here?
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Issue #
N/A
Description of changes
smithy-kotlin
. As-is, any generated Smithy client SDK is invalid (does not compile) because the client interface codegens references to a concrete client type that is not generated because no protocol is available. This has impact in codegen tests where we have to write test code in a specific way in order for the smithy sdk to compile, and also impacts ongoing work to develop and test kmp projects. It is likely that we'll have some kind of protocol in the future insmithy-kotlin
at which point we may wish to revert this change, however this is unlikely to happen soon and so I choose this approach so that codegen tests can be cleaned up and kmp work can be unblocked. Also we'll probably always want to retain the capability to generate a client sdk sans protocol.Additional Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.