Trait swagger::request_parser::RequestParser
source · pub trait RequestParser<B> {
// Required method
fn parse_operation_id(req: &Request<B>) -> Option<&'static str>;
}
Expand description
A trait for retrieving swagger-related information from a request.
This allows other middlewares to retrieve API-related information from a request that may not have been handled by the autogenerated API code yet. For example, a statistics tracking service may wish to use this to count requests per-operation.
The trait is automatically implemented by swagger-codegen.
Required Methods§
sourcefn parse_operation_id(req: &Request<B>) -> Option<&'static str>
fn parse_operation_id(req: &Request<B>) -> Option<&'static str>
Retrieve the Swagger operation identifier that matches this request.
Returns None
if this request does not match any known operation on this API.