Skip to content
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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Sources/SotoCodeGeneratorLib/AwsService+shapes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 7 additions & 3 deletions Sources/SotoCodeGeneratorLib/AwsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down
10 changes: 5 additions & 5 deletions Sources/SotoCodeGeneratorLib/Model+Patch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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": [
Expand Down Expand Up @@ -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<EnumShape>(
Expand All @@ -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
Expand All @@ -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(
Expand Down