1use serde::Deserialize;
2use spring::config::Configurable;
3
4#[derive(Debug, Configurable, Clone, Deserialize)]
5#[config_prefix = "utoipa"]
6pub struct UtoipaConfig {
7 #[serde(default = "default_path")]
8 pub path: String,
9 #[cfg(any(
10 feature = "rapidoc",
11 feature = "redoc",
12 feature = "scalar",
13 feature = "swagger-ui"
14 ))]
15 #[serde(default = "default_visualizer_path")]
16 pub visualizer_path: String,
17}
18
19fn default_path() -> String {
20 String::from("/openapi.json")
21}
22
23#[cfg(any(
24 feature = "rapidoc",
25 feature = "redoc",
26 feature = "scalar",
27 feature = "swagger-ui"
28))]
29fn default_visualizer_path() -> String {
30 String::from("/openapi")
31}