Skip to content

Conversation

@0marperez
Copy link
Contributor

@0marperez 0marperez commented Dec 17, 2025

Issue #

Description of changes

Main change:

  • Get rid of AwsHttpBindingProtocolGenerator

Secondary changes:

  • Refactor StaticHttpBindingResolver from AWS specific module to generic module
  • Refactor event streams logic from AWS specific module to generic module

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@0marperez 0marperez added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Dec 17, 2025
@0marperez 0marperez changed the title misc: collapse HTTP protocol generator inheritance misc: remove AwsHttpBindingProtocolGenerator Dec 17, 2025
@0marperez 0marperez marked this pull request as ready for review December 17, 2025 23:07
@0marperez 0marperez requested a review from a team as a code owner December 17, 2025 23:07
Comment on lines +112 to +119
writer.withBlock(
"private fun ${op.errorHandlerName()}(context: #T, call: #T, payload: #T?): #Q {",
"}",
RuntimeTypes.Core.ExecutionContext,
RuntimeTypes.Http.HttpCall,
KotlinTypes.ByteArray,
KotlinTypes.Nothing,
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Mixing Kotlin string templates with CodeWriter substitutions makes our codegen harder to read. Let's replace "${op.errorHandlerName()}" with "#L".

Comment on lines +143 to +154
.write("val errorDetails = try {")
.indent()
.call {
renderDeserializeErrorDetails(ctx, op, writer)
}
.dedent()
.withBlock("} catch (ex: Exception) {", "}") {
withBlock("""throw #T("Failed to parse response as '${ctx.protocol.name}' error", ex).also {""", "}", exceptionBaseSymbol) {
write("#T(it, wrappedCall.response, null)", RuntimeTypes.AwsProtocolCore.setAseErrorMetadata)
}
}
.write("")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Let's replace these manual indent/dedent calls with withBlock and closeAndOpenBlock.

Comment on lines +272 to +278
val ignoredTests = TestMemberDelta(
setOf(
// likely bug in Smithy's HTTP header traits spec
"RestJsonHttpEmptyPrefixHeadersRequestClient",
"HttpEmptyPrefixHeadersRequestClient",
),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Have we re-verified these omitted tests lately? Do we still need to ignore them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants