use crate::{ resource::*, result::*, routing::* }; use futures::future::ok; use gotham::{ handler::{Handler, HandlerFuture, NewHandler}, helpers::http::response::create_response, pipeline::chain::PipelineHandleChain, router::builder::*, state::State }; use indexmap::IndexMap; use log::error; use mime::{APPLICATION_JSON, TEXT_PLAIN}; use openapiv3::{MediaType, OpenAPI, Operation, PathItem, Paths, ReferenceOr, ReferenceOr::Item, Response, Responses, StatusCode}; use serde::de::DeserializeOwned; use std::panic::RefUnwindSafe; pub struct OpenapiRouter(OpenAPI); impl OpenapiRouter { pub fn new
+ Copy + Send + Sync + 'static, P : RefUnwindSafe + Send + Sync + 'static { fn get_openapi(&mut self, path : &str) { self.0.get(path).to_new_handler(OpenapiHandler::new(&self.1)); } } impl<'a, C, P> DrawResources for (&mut $implType<'a, C, P>, &mut OpenapiRouter) where C : PipelineHandleChain
+ Copy + Send + Sync + 'static,
P : RefUnwindSafe + Send + Sync + 'static
{
fn resource + Copy + Send + Sync + 'static,
P : RefUnwindSafe + Send + Sync + 'static
{
fn read_all