File tree 2 files changed +4
-12
lines changed
2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ let package = Package(
12
12
dependencies: [
13
13
. package ( url: " https://github.com/apple/swift-openapi-runtime.git " , from: " 1.0.0 " ) ,
14
14
. package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , from: " 1.0.0-alpha.1 " ) ,
15
- . package ( url: " https://github.com/swift-server/swift-aws-lambda-events.git " , from: " 0.1 .0 " ) ,
15
+ . package ( url: " https://github.com/swift-server/swift-aws-lambda-events.git " , from: " 0.3 .0 " ) ,
16
16
. package ( url: " https://github.com/apple/swift-docc-plugin " , from: " 1.3.0 " ) ,
17
17
] ,
18
18
targets: [
Original file line number Diff line number Diff line change @@ -18,18 +18,10 @@ import OpenAPIRuntime
18
18
19
19
extension APIGatewayV2Request {
20
20
21
- /// Return an `HTTPRequest.Method` for this `APIGatewayV2Request`
22
- public func httpRequestMethod( ) throws -> HTTPRequest . Method {
23
- guard let method = HTTPRequest . Method ( rawValue: self . context. http. method. rawValue) else {
24
- throw OpenAPILambdaHttpError . invalidMethod ( self . context. http. method. rawValue)
25
- }
26
- return method
27
- }
28
-
29
21
/// Return an `HTTPRequest` for this `APIGatewayV2Request`
30
22
public func httpRequest( ) throws -> HTTPRequest {
31
- try HTTPRequest (
32
- method: self . httpRequestMethod ( ) ,
23
+ HTTPRequest (
24
+ method: self . context . http . method ,
33
25
scheme: " https " ,
34
26
authority: " " ,
35
27
path: self . rawPath,
@@ -43,7 +35,7 @@ extension APIGatewayV2Response {
43
35
/// Create a `APIGatewayV2Response` from an `HTTPResponse`
44
36
public init ( from response: HTTPResponse ) {
45
37
self = APIGatewayV2Response (
46
- statusCode: . init ( code : UInt ( response. status. code ) ) ,
38
+ statusCode: response. status,
47
39
headers: . init( from: response. headerFields) ,
48
40
isBase64Encoded: false ,
49
41
cookies: nil
You can’t perform that action at this time.
0 commit comments