Skip to content

Commit 8d3e822

Browse files
committed
expose router protocol to allow client to add routes (such as /health)
1 parent bafef5a commit 8d3e822

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/OpenAPILambdaTransport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public typealias OpenAPIHandler = (HTTPRequest, HTTPBody?, ServerRequestMetadata
3737
/// Lambda Transport for OpenAPI generator
3838
public struct OpenAPILambdaTransport: ServerTransport {
3939

40-
private let router: OpenAPILambdaRouter
40+
public let router: OpenAPILambdaRouter
4141

4242
/// Create a `OpenAPILambdaTransport` with the given `OpenAPILambdaRouter`
4343
init(router: OpenAPILambdaRouter) { self.router = router }

Sources/Router/OpenAPILambdaRouter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public enum OpenAPILambdaRouterError: Error {
2424
}
2525

2626
/// A router API
27-
protocol OpenAPILambdaRouter {
27+
public protocol OpenAPILambdaRouter {
2828
/// add a route for a given HTTP method and path and associate a handler
2929
func add(method: HTTPRequest.Method, path: String, handler: @escaping OpenAPIHandler) throws
3030

0 commit comments

Comments
 (0)