use crate::{openapi_utils, rest_router_builder::RestRouterBuilder};
use utoipa::openapi::OpenApi;
pub fn build_openapi_from_inventory(title: &str, version: &str, description: &str, tag: &str) -> OpenApi {
openapi_utils::build_openapi_basic(title, version, description, tag)
}
pub fn rest_router_from_inventory(title: &str, version: &str, description: &str, tag: &str) -> crate::error::Result<axum::Router> {
let openapi = build_openapi_from_inventory(title, version, description, tag);
RestRouterBuilder::new().openapi(openapi).build()
}
pub fn rest_router_from_openapi(openapi: OpenApi) -> crate::error::Result<axum::Router> {
RestRouterBuilder::new().openapi(openapi).build()
}
#[cfg(all(not(target_arch = "wasm32"), feature = "mcp"))]
pub fn mcp_router_from_inventory<S: Send + Sync + 'static>(title: &str, version: &str, description: &str, tag: &str) -> crate::error::Result<rmcp::handler::server::router::tool::ToolRouter<S>> {
let openapi = build_openapi_from_inventory(title, version, description, tag);
crate::openapi_to_mcp::OpenApiMcpRouterBuilder::new().openapi(openapi).build()
}
#[cfg(all(not(target_arch = "wasm32"), feature = "mcp"))]
pub fn mcp_router_from_openapi<S: Send + Sync + 'static>(openapi: OpenApi) -> crate::error::Result<rmcp::handler::server::router::tool::ToolRouter<S>> {
crate::openapi_to_mcp::OpenApiMcpRouterBuilder::new().openapi(openapi).build()
}