diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/PresignerGenerator.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/PresignerGenerator.kt index 1393e9d4585..df75834693e 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/PresignerGenerator.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/PresignerGenerator.kt @@ -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,""") } } diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_0.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_0.kt index be5d17832df..fcecacd340a 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_0.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_0.kt @@ -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 { val httpMiddleware = super.getDefaultHttpMiddleware(ctx) diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_1.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_1.kt index cb0b2e3ea93..f7dbc18bada 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_1.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/AwsJson1_1.kt @@ -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 { val httpMiddleware = super.getDefaultHttpMiddleware(ctx) diff --git a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/json/JsonHttpBindingProtocolGenerator.kt b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/json/JsonHttpBindingProtocolGenerator.kt index 79644441b14..318e60bbf5d 100644 --- a/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/json/JsonHttpBindingProtocolGenerator.kt +++ b/codegen/smithy-aws-kotlin-codegen/src/main/kotlin/aws/sdk/kotlin/codegen/protocols/json/JsonHttpBindingProtocolGenerator.kt @@ -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, diff --git a/gradle.properties b/gradle.properties index e78973da841..334cf051ad4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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