From 1e5b0080e2dc780e463caf22e6aeaf4ced505506 Mon Sep 17 00:00:00 2001 From: komi1230 Date: Thu, 8 Sep 2022 22:59:18 +0900 Subject: [PATCH] Keep existing url config --- utoipa-swagger-ui/src/axum.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utoipa-swagger-ui/src/axum.rs b/utoipa-swagger-ui/src/axum.rs index c99e2e95..0fbe5a56 100644 --- a/utoipa-swagger-ui/src/axum.rs +++ b/utoipa-swagger-ui/src/axum.rs @@ -34,7 +34,11 @@ where ); let config = if let Some(config) = swagger_ui.config { - config.configure_defaults(urls) + if config.url.is_some() || !config.urls.is_empty() { + config + } else { + config.configure_defaults(urls) + } } else { Config::new(urls) };