You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Intercepts an outgoing HTTP request and an incoming HTTP Response, and converts errors(if any) that confirms to ``HTTPResponseConvertible`` to an HTTP response.
53
+
/// - Parameters:
54
+
/// - request: The HTTP request created during the operation.
55
+
/// - body: The HTTP request body created during the operation.
56
+
/// - metadata: Request metadata
57
+
/// - operationID: The OpenAPI operation identifier.
58
+
/// - next: A closure that calls the next middleware, or the transport.
59
+
/// - Returns: An HTTPResponse and an optional HTTPBody.
48
60
publicfunc intercept(
49
61
_ request:HTTPTypes.HTTPRequest,
50
62
body:OpenAPIRuntime.HTTPBody?,
@@ -66,14 +78,13 @@ public struct ErrorHandlingMiddleware: ServerMiddleware {
66
78
}
67
79
}
68
80
69
-
/// A protocol used by ``ErrorHandlingMiddleware`` to map an error to an `HTTPResponse` and ``HTTPBody``.
81
+
/// A protocol used by ``ErrorHandlingMiddleware`` to map an error to an ``HTTPResponse`` and ``HTTPBody``.
70
82
/// Adopters who wish to convert their application error to an `HTTPResponse` and ``HTTPBody`` should conform the error type to this protocol.
71
83
publicprotocolHTTPResponseConvertible{
72
84
73
85
/// An HTTP status to return in the response.
74
86
varhttpStatus:HTTPResponse.Status{get}
75
87
/// The HTTP headers of the response.
76
-
///
77
88
/// This is optional as default values are provided in the extension.
0 commit comments