{{~#each operations as |operation|~}} use crate::server::handler::{{upper_camel operation.operationId}}Trait; {{~/each~}} use crate::server::{PreHandler, Router}; use argentum_rest_infrastructure::service::{ {{#if securityEnabled}} BearerAuthenticator, {{/if}} ErrorPreHandler, RequestTransformer, }; use std::sync::Arc; pub struct ApiDiC { pub router: Arc, } impl ApiDiC { pub fn new( //config url_prefix: String, //services request_transformer: Arc, {{#if securityEnabled}} bearer_auth: Arc, {{/if}} {{#each operations as |operation|}} {{snake operation.operationId}}_handler: Arc, {{/each}} error_pre_handler: Arc, ) -> Self { let pre_handler = Arc::new(PreHandler::new( request_transformer, {{#if securityEnabled}} bearer_auth, {{/if}} {{#each operations as |operation|}} {{snake operation.operationId}}_handler, {{/each}} )); let router = Arc::new(Router::new( pre_handler, error_pre_handler, url_prefix, )); ApiDiC { router } } }