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: update smithy to 1.42.0 #1261

Merged
merged 4 commits into from
Dec 13, 2023
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 @@ -53,6 +53,7 @@ abstract class AWSHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
val responseTestBuilder = HttpProtocolUnitTestResponseGenerator.Builder()
val errorTestBuilder = HttpProtocolUnitTestErrorGenerator.Builder()
open val testsToIgnore: Set<String> = setOf()
open val tagsToIgnore: Set<String> = setOf()

override val shouldRenderDecodableBodyStructForInputShapes = true
override val shouldRenderCodingKeysForEncodable = true
Expand All @@ -69,7 +70,8 @@ abstract class AWSHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
getProtocolHttpBindingResolver(ctx, defaultContentType),
serdeContext,
imports,
testsToIgnore
testsToIgnore,
tagsToIgnore,
).generateProtocolTests() + renderEndpointsTests(ctx)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ open class AwsJson1_0_ProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val httpResponseGenerator = HttpResponseGenerator(
unknownServiceErrorSymbol,
defaultTimestampFormat,
AWSJsonHttpResponseBindingErrorGenerator()
AWSJsonHttpResponseBindingErrorGenerator(),
)
override val serdeContext = serdeContextJSON
override val shouldRenderEncodableConformance: Boolean = true
override val shouldRenderDecodableBodyStructForInputShapes: Boolean = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_awsJson1_0",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0"
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0",
)
override val tagsToIgnore = setOf("defaults")
override fun getProtocolHttpBindingResolver(ctx: ProtocolGenerator.GenerationContext, defaultContentType: String):
HttpBindingResolver = AwsJsonHttpBindingResolver(ctx, defaultContentType)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ class AwsJson1_1_ProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val httpResponseGenerator = HttpResponseGenerator(
unknownServiceErrorSymbol,
defaultTimestampFormat,
AWSJsonHttpResponseBindingErrorGenerator()
AWSJsonHttpResponseBindingErrorGenerator(),
)
override val serdeContext = serdeContextJSON
override val shouldRenderEncodableConformance: Boolean = true
override val shouldRenderDecodableBodyStructForInputShapes: Boolean = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_awsJson1_1",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1"
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1",
)
override val tagsToIgnore = setOf("defaults")
override fun getProtocolHttpBindingResolver(ctx: ProtocolGenerator.GenerationContext, defaultContentType: String):
HttpBindingResolver = AwsJsonHttpBindingResolver(ctx, defaultContentType)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ open class AwsQueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
unknownServiceErrorSymbol,
defaultTimestampFormat,
AWSRestXMLHttpResponseBindingErrorGenerator(),
AWSXMLHttpResponseBindingErrorInitGeneratorFactory()
AWSXMLHttpResponseBindingErrorInitGeneratorFactory(),
)

override val serdeContext = HttpProtocolUnitTestGenerator.SerdeContext("FormURLEncoder()", "XMLDecoder()")
Expand All @@ -56,16 +56,17 @@ open class AwsQueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val shouldRenderEncodableConformance = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_awsQuery",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery"
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery",
)
override val tagsToIgnore = setOf("defaults")
override fun renderStructEncode(
ctx: ProtocolGenerator.GenerationContext,
shapeContainingMembers: Shape,
shapeMetadata: Map<ShapeMetadata, Any>,
members: List<MemberShape>,
writer: SwiftWriter,
defaultTimestampFormat: TimestampFormatTrait.Format,
path: String?
path: String?,
) {
val customizations = AwsQueryFormURLEncodeCustomizations()
val encoder = StructEncodeFormURLGenerator(ctx, customizations, shapeContainingMembers, shapeMetadata, members, writer, defaultTimestampFormat)
Expand All @@ -78,7 +79,7 @@ open class AwsQueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
members: List<MemberShape>,
writer: SwiftWriter,
defaultTimestampFormat: TimestampFormatTrait.Format,
path: String
path: String,
) {
val decoder = AwsQueryStructDecodeXMLGenerator(ctx, members, shapeMetadata, writer, defaultTimestampFormat)
decoder.render()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Ec2QueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
unknownServiceErrorSymbol,
defaultTimestampFormat,
AWSEc2QueryHttpResponseBindingErrorGenerator(),
AWSEc2QueryHttpResponseBindingErrorInitGeneratorFactory()
AWSEc2QueryHttpResponseBindingErrorInitGeneratorFactory(),
)

override val serdeContext = HttpProtocolUnitTestGenerator.SerdeContext("FormURLEncoder()", "XMLDecoder()")
Expand All @@ -52,16 +52,17 @@ class Ec2QueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val shouldRenderEncodableConformance = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_ec2Query",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query"
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query",
)
override val tagsToIgnore = setOf("defaults")
override fun renderStructEncode(
ctx: ProtocolGenerator.GenerationContext,
shapeContainingMembers: Shape,
shapeMetadata: Map<ShapeMetadata, Any>,
members: List<MemberShape>,
writer: SwiftWriter,
defaultTimestampFormat: TimestampFormatTrait.Format,
path: String?
path: String?,
) {
val customizations = Ec2QueryFormURLEncodeCustomizations()
val encoder = StructEncodeFormURLGenerator(ctx, customizations, shapeContainingMembers, shapeMetadata, members, writer, defaultTimestampFormat)
Expand All @@ -74,7 +75,7 @@ class Ec2QueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
members: List<MemberShape>,
writer: SwiftWriter,
defaultTimestampFormat: TimestampFormatTrait.Format,
path: String
path: String,
) {
val decoder = StructDecodeXMLGenerator(ctx, members, mapOf(), writer, defaultTimestampFormat)
decoder.render()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ class AWSRestJson1ProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val httpResponseGenerator = HttpResponseGenerator(
unknownServiceErrorSymbol,
defaultTimestampFormat,
AWSRestJson1HttpResponseBindingErrorGeneratable()
AWSRestJson1HttpResponseBindingErrorGeneratable(),
)
override val serdeContext = serdeContextJSON
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_restJson1",
"SDKAppendedGzipAfterProvidedEncoding_restJson1",
"RestJsonHttpPayloadWithUnsetUnion"
"RestJsonHttpPayloadWithUnsetUnion",
)
override val tagsToIgnore = setOf("defaults")

override fun generateMessageMarshallable(ctx: ProtocolGenerator.GenerationContext) {
var streamingShapes = outputStreamingShapes(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
unknownServiceErrorSymbol,
defaultTimestampFormat,
AWSRestXMLHttpResponseBindingErrorGenerator(),
AWSXMLHttpResponseBindingErrorInitGeneratorFactory()
AWSXMLHttpResponseBindingErrorInitGeneratorFactory(),
)
override val shouldRenderDecodableBodyStructForInputShapes = false
override val serdeContext = serdeContextXML
Expand All @@ -47,8 +47,9 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
"S3EscapePathObjectKeyInUriLabel",
"SDKAppliedContentEncoding_restXml",
"SDKAppendedGzipAfterProvidedEncoding_restXml",
"S3OperationNoErrorWrappingResponse"
"S3OperationNoErrorWrappingResponse",
)
override val tagsToIgnore = setOf("defaults")

override val codableProtocol = SwiftTypes.Protocols.Decodable
override val encodableProtocol = null
Expand All @@ -61,7 +62,7 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
members: List<MemberShape>,
writer: SwiftWriter,
defaultTimestampFormat: TimestampFormatTrait.Format,
path: String?
path: String?,
) {
val encoder = StructEncodeXMLGenerator(ctx, shapeContainingMembers, members, writer)
encoder.render()
Expand All @@ -73,7 +74,7 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
members: List<MemberShape>,
writer: SwiftWriter,
defaultTimestampFormat: TimestampFormatTrait.Format,
path: String
path: String,
) {
val decoder = RestXmlStructDecodeXMLGenerator(ctx, members, shapeMetadata, writer, defaultTimestampFormat)
decoder.render()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx4096M

# codegen
smithyVersion=1.39.0
smithyVersion=1.42.0
smithyGradleVersion=0.6.0

smithySwiftVersion = 0.1.0
Expand Down
Loading