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

chore: upgrade smithy to 1.17.0 #521

Merged
merged 3 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class PresignerGenerator : KotlinIntegration {
writer.addImport(RuntimeTypes.Http.QueryParameters)
writer.addImport(RuntimeTypes.Http.toByteStream)
writer.addImport(RuntimeTypes.Core.Content.decodeToString)
writer.addImport(RuntimeTypes.Http.splitAsQueryParameters)
writer.addImport(RuntimeTypes.Http.Util.splitAsQueryParameters)
writer.write("""httpRequestBuilder.body.toByteStream()?.decodeToString()?.splitAsQueryParameters() ?: QueryParameters.Empty,""")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import software.amazon.smithy.model.shapes.*
* @see AwsHttpBindingProtocolGenerator
*/
class AwsJson1_0 : JsonHttpBindingProtocolGenerator() {

override val protocol: ShapeId = AwsJson1_0Trait.ID
override val supportsJsonNameTrait: Boolean = false

override fun getDefaultHttpMiddleware(ctx: ProtocolGenerator.GenerationContext): List<ProtocolMiddleware> {
val httpMiddleware = super.getDefaultHttpMiddleware(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import software.amazon.smithy.model.shapes.ShapeId
*/
class AwsJson1_1 : JsonHttpBindingProtocolGenerator() {
override val protocol: ShapeId = AwsJson1_1Trait.ID
override val supportsJsonNameTrait: Boolean = false

override fun getDefaultHttpMiddleware(ctx: ProtocolGenerator.GenerationContext): List<ProtocolMiddleware> {
val httpMiddleware = super.getDefaultHttpMiddleware(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ abstract class JsonHttpBindingProtocolGenerator : AwsHttpBindingProtocolGenerato

override val defaultTimestampFormat: TimestampFormatTrait.Format = TimestampFormatTrait.Format.EPOCH_SECONDS

/**
* Flag indicating if the jsonName trait is supported or not. When true the trait is processed when generating
* serializers and deserializers. When false the member name is used.
*/
open val supportsJsonNameTrait: Boolean = true

override fun structuredDataParser(ctx: ProtocolGenerator.GenerationContext): StructuredDataParserGenerator =
JsonParserGenerator(this)
JsonParserGenerator(this, supportsJsonNameTrait = supportsJsonNameTrait)

override fun structuredDataSerializer(ctx: ProtocolGenerator.GenerationContext): StructuredDataSerializerGenerator =
JsonSerializerGenerator(this)
JsonSerializerGenerator(this, supportsJsonNameTrait = supportsJsonNameTrait)

override fun renderDeserializeErrorDetails(
ctx: ProtocolGenerator.GenerationContext,
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ org.gradle.jvmargs=-Xmx6g -XX:MaxPermSize=6g -XX:MaxMetaspaceSize=1G
sdkVersion=0.12.1-SNAPSHOT

# codegen
smithyVersion=1.13.1
smithyVersion=1.17.0
smithyGradleVersion=0.5.3
# smithy-kotlin codegen and runtime are versioned together
smithyKotlinVersion=0.7.7
smithyKotlinVersion=0.7.8-SNAPSHOT

# kotlin
kotlinVersion=1.6.10
Expand Down