diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83d9a5c..d4ba68f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: runs-on: macOS-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: SPM tests run: | swift --version @@ -26,13 +26,14 @@ jobs: strategy: matrix: tag: - - swift:5.10 - swift:6.0 + - swift:6.1 + - swift:6.2 container: image: ${{ matrix.tag }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Test run: | swift --version diff --git a/Sources/SotoCodeGeneratorLib/AwsService+shapes.swift b/Sources/SotoCodeGeneratorLib/AwsService+shapes.swift index 292abfb..eca5034 100644 --- a/Sources/SotoCodeGeneratorLib/AwsService+shapes.swift +++ b/Sources/SotoCodeGeneratorLib/AwsService+shapes.swift @@ -369,6 +369,8 @@ extension AwsService { var memberCodableContext: MemberCodableContext if let headerTrait = member.trait(type: HttpHeaderTrait.self) { memberCodableContext = .init(inHeader: headerTrait.value, codableType: type) + } else if let _ = member.trait(type: EventHeaderTrait.self) { + memberCodableContext = .init(inHeader: name, codableType: type) } else if let headerTrait = member.trait(type: HttpPrefixHeadersTrait.self) { memberCodableContext = .init(inHeader: headerTrait.value, codableType: type) } else if member.hasTrait(type: HttpResponseCodeTrait.self), isOutputShape { diff --git a/Sources/SotoCodeGeneratorLib/AwsService.swift b/Sources/SotoCodeGeneratorLib/AwsService.swift index f19d828..5eff045 100644 --- a/Sources/SotoCodeGeneratorLib/AwsService.swift +++ b/Sources/SotoCodeGeneratorLib/AwsService.swift @@ -765,9 +765,13 @@ struct AwsService { } func isMemberInBody(_ member: MemberShape, isOutputShape: Bool) -> Bool { - !(member.hasTrait(type: HttpHeaderTrait.self) || member.hasTrait(type: HttpPrefixHeadersTrait.self) - || (member.hasTrait(type: HttpQueryTrait.self) && !isOutputShape) || member.hasTrait(type: HttpQueryParamsTrait.self) - || member.hasTrait(type: HttpLabelTrait.self) || member.hasTrait(type: HttpResponseCodeTrait.self)) + !(member.hasTrait(type: HttpHeaderTrait.self) + || member.hasTrait(type: EventHeaderTrait.self) + || member.hasTrait(type: HttpPrefixHeadersTrait.self) + || (member.hasTrait(type: HttpQueryTrait.self) && !isOutputShape) + || member.hasTrait(type: HttpQueryParamsTrait.self) + || member.hasTrait(type: HttpLabelTrait.self) + || member.hasTrait(type: HttpResponseCodeTrait.self)) } } diff --git a/Sources/SotoCodeGeneratorLib/Model+Patch.swift b/Sources/SotoCodeGeneratorLib/Model+Patch.swift index e47f057..495c67a 100644 --- a/Sources/SotoCodeGeneratorLib/Model+Patch.swift +++ b/Sources/SotoCodeGeneratorLib/Model+Patch.swift @@ -45,7 +45,7 @@ extension Model { patch: AddTraitPatch(trait: EnumTrait(value: .init([.init(value: "HTTP1_1"), .init(value: "HTTP2")]))) ), "com.amazonaws.cloudfront#DistributionSummary$HttpVersion": EditShapePatch { (shape: MemberShape) in - return MemberShape(target: "com.amazonaws.cloudfront#UppercaseHttpVersion", traits: shape.traits) + MemberShape(target: "com.amazonaws.cloudfront#UppercaseHttpVersion", traits: shape.traits) }, ], "CloudWatch": [ @@ -67,7 +67,7 @@ extension Model { "DynamoDB": [ // Make TransactWriteItem an enum with associated values "com.amazonaws.dynamodb#TransactWriteItem": EditShapePatch { (shape: StructureShape) in - return UnionShape(traits: shape.traits, members: shape.members) + UnionShape(traits: shape.traits, members: shape.members) } ], "EC2": [ @@ -116,7 +116,7 @@ extension Model { ) ), "com.amazonaws.lambda#ListFunctionsRequest$MasterRegion": EditShapePatch { (shape: MemberShape) in - return MemberShape(target: "com.amazonaws.lambda#SotoCore.Region", traits: shape.traits) + MemberShape(target: "com.amazonaws.lambda#SotoCore.Region", traits: shape.traits) }, // https://github.com/soto-project/soto/issues/720 "com.amazonaws.lambda#LastUpdateStatusReasonCode": AddShapeMemberPatch( @@ -134,7 +134,7 @@ extension Model { ], "RDSData": [ // See https://github.com/soto-project/soto/issues/471 - "com.amazonaws.rdsdata#Arn": EditTraitPatch { trait in return LengthTrait(min: trait.min, max: 2048) } + "com.amazonaws.rdsdata#Arn": EditTraitPatch { trait in LengthTrait(min: trait.min, max: 2048) } ], "Route53": [ // pagination tokens in response shouldnt be required @@ -144,7 +144,7 @@ extension Model { ], "S3": [ // https://github.com/soto-project/soto/issues/311 - "com.amazonaws.s3#CopySource": EditTraitPatch { _ in return PatternTrait(value: ".+\\/.+") }, + "com.amazonaws.s3#CopySource": EditTraitPatch { _ in PatternTrait(value: ".+\\/.+") }, "com.amazonaws.s3#LifecycleRule$Filter": AddTraitPatch(trait: RequiredTrait()), // https://github.com/soto-project/soto/issues/502 "com.amazonaws.s3#BucketLocationConstraint": MultiplePatch(