-
Notifications
You must be signed in to change notification settings - Fork 30
misc: remove AwsHttpBindingProtocolGenerator #1470
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
base: main
Are you sure you want to change the base?
Conversation
…ic to generic module
| writer.withBlock( | ||
| "private fun ${op.errorHandlerName()}(context: #T, call: #T, payload: #T?): #Q {", | ||
| "}", | ||
| RuntimeTypes.Core.ExecutionContext, | ||
| RuntimeTypes.Http.HttpCall, | ||
| KotlinTypes.ByteArray, | ||
| KotlinTypes.Nothing, | ||
| ) { |
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: Mixing Kotlin string templates with CodeWriter substitutions makes our codegen harder to read. Let's replace "${op.errorHandlerName()}" with "#L".
| .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("") |
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: Let's replace these manual indent/dedent calls with withBlock and closeAndOpenBlock.
| val ignoredTests = TestMemberDelta( | ||
| setOf( | ||
| // likely bug in Smithy's HTTP header traits spec | ||
| "RestJsonHttpEmptyPrefixHeadersRequestClient", | ||
| "HttpEmptyPrefixHeadersRequestClient", | ||
| ), | ||
| ) |
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.
Question: Have we re-verified these omitted tests lately? Do we still need to ignore them?
Issue #
Description of changes
Main change:
AwsHttpBindingProtocolGeneratorSecondary changes:
StaticHttpBindingResolverfrom AWS specific module to generic moduleBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.