Skip to content

Commit

Permalink
Check HttpChecksumRequiredTrait for HTTP checksum requirements (#47)
Browse files Browse the repository at this point in the history
* Check HttpChecksumRequiredTrait

* swift format
  • Loading branch information
adam-fowler authored Mar 25, 2022
1 parent 21d535b commit a804bd6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Sources/SotoCodeGeneratorLib/AwsService+shapes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ extension AwsService {

// get payload options
let operationShape = shape.trait(type: SotoRequestShapeTrait.self)?.operationShape
if operationShape?.hasTrait(type: HttpChecksumRequiredTrait.self) == true {
shapeOptions.append("md5ChecksumRequired")
if operationShape?.hasTrait(type: AwsHttpChecksumTrait.self) == true {
shapeOptions.append("checksumHeader")
}
if operationShape?.hasTrait(type: HttpChecksumRequiredTrait.self) == true ||
operationShape?.trait(type: AwsHttpChecksumTrait.self)?.requestChecksumRequired == true
{
shapeOptions.append("checksumRequired")
}
// search for content-md5 header
if let members = shape.members {
Expand Down

0 comments on commit a804bd6

Please sign in to comment.