Function rweb::docs::openapi_docs[][src]

pub fn openapi_docs(spec: Spec) -> BoxedFilter<(impl Reply,)>
Expand description

Helper filter that exposes an openapi spec on the /docs endpoint.

Example - single use with data injection

let (spec, filter) = openapi::spec().build(|| index());
serve(filter.or(openapi_docs(spec)))
.run(([127, 0, 0, 1], 3030))
.await;