From fd0f7db4861fa359b3399090228e767de2ff6d89 Mon Sep 17 00:00:00 2001
From: ok300 <106775972+ok300@users.noreply.github.com>
Date: Mon, 21 Oct 2024 08:29:19 +0200
Subject: [PATCH] Place utoipa traits and structs behind swagger feature

---
 .github/workflows/ci.yml                |  2 +
 crates/cdk-axum/Cargo.toml              |  5 ++-
 crates/cdk-axum/src/lib.rs              |  4 +-
 crates/cdk-axum/src/router_handlers.rs  | 52 ++++++++++++-------------
 crates/cdk-mintd/Cargo.toml             |  7 +++-
 crates/cdk-mintd/src/main.rs            | 14 ++++---
 crates/cdk/Cargo.toml                   |  3 +-
 crates/cdk/src/amount.rs                |  2 +-
 crates/cdk/src/error.rs                 |  4 +-
 crates/cdk/src/nuts/nut00/mod.rs        | 20 +++++-----
 crates/cdk/src/nuts/nut01/mod.rs        |  4 +-
 crates/cdk/src/nuts/nut01/public_key.rs |  4 +-
 crates/cdk/src/nuts/nut01/secret_key.rs |  4 +-
 crates/cdk/src/nuts/nut02.rs            | 10 ++---
 crates/cdk/src/nuts/nut03.rs            |  6 +--
 crates/cdk/src/nuts/nut04.rs            | 18 ++++-----
 crates/cdk/src/nuts/nut05.rs            | 16 ++++----
 crates/cdk/src/nuts/nut06.rs            | 10 ++---
 crates/cdk/src/nuts/nut07.rs            | 12 +++---
 crates/cdk/src/nuts/nut09.rs            |  4 +-
 crates/cdk/src/nuts/nut11/mod.rs        |  2 +-
 crates/cdk/src/nuts/nut12.rs            | 14 +++----
 crates/cdk/src/nuts/nut14/mod.rs        |  2 +-
 crates/cdk/src/nuts/nut15.rs            |  6 +--
 24 files changed, 118 insertions(+), 107 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cd3956f8c..37149ba2b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -46,6 +46,7 @@ jobs:
             -p cdk --no-default-features,
             -p cdk --no-default-features --features wallet,
             -p cdk --no-default-features --features mint,
+            -p cdk --no-default-features --features "mint swagger",
             -p cdk-redb,
             -p cdk-sqlite,
             -p cdk-axum,
@@ -143,6 +144,7 @@ jobs:
             -p cdk --no-default-features,
             -p cdk --no-default-features --features wallet,
             -p cdk --no-default-features --features mint,
+            -p cdk --no-default-features --features "mint swagger",
             -p cdk-axum,
             -p cdk-strike,
             -p cdk-lnbits,
diff --git a/crates/cdk-axum/Cargo.toml b/crates/cdk-axum/Cargo.toml
index 8867df4fb..241da9627 100644
--- a/crates/cdk-axum/Cargo.toml
+++ b/crates/cdk-axum/Cargo.toml
@@ -15,8 +15,11 @@ axum = "0.6.20"
 cdk = { path = "../cdk", version = "0.4.0", default-features = false, features = ["mint"] }
 tokio = { version = "1", default-features = false }
 tracing = { version = "0.1", default-features = false, features = ["attributes", "log"] }
-utoipa = { version = "4", features = ["preserve_order", "preserve_path_order"] }
+utoipa = { version = "4", features = ["preserve_order", "preserve_path_order"], optional = true }
 futures = { version = "0.3.28", default-features = false }
 moka = { version = "0.11.1", features = ["future"] }
 serde_json = "1"
 paste = "1.0.15"
+
+[features]
+swagger = ["cdk/swagger", "dep:utoipa"]
\ No newline at end of file
diff --git a/crates/cdk-axum/src/lib.rs b/crates/cdk-axum/src/lib.rs
index 46ef06e49..283a0afc0 100644
--- a/crates/cdk-axum/src/lib.rs
+++ b/crates/cdk-axum/src/lib.rs
@@ -38,7 +38,6 @@ use cdk::nuts::nut15::{Mpp, MppMethodSettings};
 use cdk::nuts::{MeltQuoteState, MintQuoteState};
 use moka::future::Cache;
 use router_handlers::*;
-use utoipa::OpenApi;
 
 mod router_handlers;
 
@@ -49,7 +48,8 @@ pub struct MintState {
     cache: Cache<String, String>,
 }
 
-#[derive(OpenApi)]
+#[cfg(feature = "swagger")]
+#[derive(utoipa::OpenApi)]
 #[openapi(
     components(schemas(
         Amount,
diff --git a/crates/cdk-axum/src/router_handlers.rs b/crates/cdk-axum/src/router_handlers.rs
index b0aed2c7a..c4ba781ab 100644
--- a/crates/cdk-axum/src/router_handlers.rs
+++ b/crates/cdk-axum/src/router_handlers.rs
@@ -49,14 +49,14 @@ post_cache_wrapper!(post_swap, SwapRequest, SwapResponse);
 post_cache_wrapper!(post_mint_bolt11, MintBolt11Request, MintBolt11Response);
 post_cache_wrapper!(post_melt_bolt11, MeltBolt11Request, MeltQuoteBolt11Response);
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     get,
     context_path = "/v1",
     path = "/keys",
     responses(
         (status = 200, description = "Successful response", body = KeysResponse, content_type = "application/json")
     )
-)]
+))]
 /// Get the public keys of the newest mint keyset
 ///
 /// This endpoint returns a dictionary of all supported token values of the mint and their associated public key.
@@ -69,7 +69,7 @@ pub async fn get_keys(State(state): State<MintState>) -> Result<Json<KeysRespons
     Ok(Json(pubkeys))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     get,
     context_path = "/v1",
     path = "/keys/{keyset_id}",
@@ -80,7 +80,7 @@ pub async fn get_keys(State(state): State<MintState>) -> Result<Json<KeysRespons
         (status = 200, description = "Successful response", body = KeysResponse, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Get the public keys of a specific keyset
 ///
 /// Get the public keys of the mint from a specific keyset ID.
@@ -96,7 +96,7 @@ pub async fn get_keyset_pubkeys(
     Ok(Json(pubkeys))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     get,
     context_path = "/v1",
     path = "/keysets",
@@ -104,7 +104,7 @@ pub async fn get_keyset_pubkeys(
         (status = 200, description = "Successful response", body = KeysetResponse, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Get all active keyset IDs of the mint
 ///
 /// This endpoint returns a list of keysets that the mint currently supports and will accept tokens from.
@@ -117,7 +117,7 @@ pub async fn get_keysets(State(state): State<MintState>) -> Result<Json<KeysetRe
     Ok(Json(keysets))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/mint/quote/bolt11",
@@ -126,7 +126,7 @@ pub async fn get_keysets(State(state): State<MintState>) -> Result<Json<KeysetRe
         (status = 200, description = "Successful response", body = MintQuoteBolt11Response, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Request a quote for minting of new tokens
 ///
 /// Request minting of new tokens. The mint responds with a Lightning invoice. This endpoint can be used for a Lightning invoice UX flow.
@@ -143,7 +143,7 @@ pub async fn get_mint_bolt11_quote(
     Ok(Json(quote))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     get,
     context_path = "/v1",
     path = "/mint/quote/bolt11/{quote_id}",
@@ -154,7 +154,7 @@ pub async fn get_mint_bolt11_quote(
         (status = 200, description = "Successful response", body = MintQuoteBolt11Response, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Get mint quote by ID
 ///
 /// Get mint quote state.
@@ -174,7 +174,7 @@ pub async fn get_check_mint_bolt11_quote(
     Ok(Json(quote))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/mint/bolt11",
@@ -183,7 +183,7 @@ pub async fn get_check_mint_bolt11_quote(
         (status = 200, description = "Successful response", body = MintBolt11Response, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Mint tokens by paying a BOLT11 Lightning invoice.
 ///
 /// Requests the minting of tokens belonging to a paid payment request.
@@ -205,7 +205,7 @@ pub async fn post_mint_bolt11(
     Ok(Json(res))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/melt/quote/bolt11",
@@ -214,7 +214,7 @@ pub async fn post_mint_bolt11(
         (status = 200, description = "Successful response", body = MeltQuoteBolt11Response, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Request a quote for melting tokens
 pub async fn get_melt_bolt11_quote(
     State(state): State<MintState>,
@@ -229,7 +229,7 @@ pub async fn get_melt_bolt11_quote(
     Ok(Json(quote))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     get,
     context_path = "/v1",
     path = "/melt/quote/bolt11/{quote_id}",
@@ -240,7 +240,7 @@ pub async fn get_melt_bolt11_quote(
         (status = 200, description = "Successful response", body = MeltQuoteBolt11Response, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Get melt quote by ID
 ///
 /// Get melt quote state.
@@ -260,7 +260,7 @@ pub async fn get_check_melt_bolt11_quote(
     Ok(Json(quote))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/melt/bolt11",
@@ -269,7 +269,7 @@ pub async fn get_check_melt_bolt11_quote(
         (status = 200, description = "Successful response", body = MeltQuoteBolt11Response, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Melt tokens for a Bitcoin payment that the mint will make for the user in exchange
 ///
 /// Requests tokens to be destroyed and sent out via Lightning.
@@ -286,7 +286,7 @@ pub async fn post_melt_bolt11(
     Ok(Json(res))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/checkstate",
@@ -295,7 +295,7 @@ pub async fn post_melt_bolt11(
         (status = 200, description = "Successful response", body = CheckStateResponse, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Check whether a proof is spent already or is pending in a transaction
 ///
 /// Check whether a secret has been spent already or not.
@@ -311,20 +311,20 @@ pub async fn post_check(
     Ok(Json(state))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     get,
     context_path = "/v1",
     path = "/info",
     responses(
         (status = 200, description = "Successful response", body = MintInfo)
     )
-)]
+))]
 /// Mint information, operator contact information, and other info
 pub async fn get_mint_info(State(state): State<MintState>) -> Result<Json<MintInfo>, Response> {
     Ok(Json(state.mint.mint_info().clone().time(unix_time())))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/swap",
@@ -333,7 +333,7 @@ pub async fn get_mint_info(State(state): State<MintState>) -> Result<Json<MintIn
         (status = 200, description = "Successful response", body = SwapResponse, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Swap inputs for outputs of the same value
 ///
 /// Requests a set of Proofs to be swapped for another set of BlindSignatures.
@@ -354,7 +354,7 @@ pub async fn post_swap(
     Ok(Json(swap_response))
 }
 
-#[utoipa::path(
+#[cfg_attr(feature = "swagger", utoipa::path(
     post,
     context_path = "/v1",
     path = "/restore",
@@ -363,7 +363,7 @@ pub async fn post_swap(
         (status = 200, description = "Successful response", body = RestoreResponse, content_type = "application/json"),
         (status = 500, description = "Server error", body = ErrorResponse, content_type = "application/json")
     )
-)]
+))]
 /// Restores blind signature for a set of outputs.
 pub async fn post_restore(
     State(state): State<MintState>,
diff --git a/crates/cdk-mintd/Cargo.toml b/crates/cdk-mintd/Cargo.toml
index a201f9072..34640215e 100644
--- a/crates/cdk-mintd/Cargo.toml
+++ b/crates/cdk-mintd/Cargo.toml
@@ -34,5 +34,8 @@ tower-http = { version = "0.4.4", features = ["cors"] }
 lightning-invoice = { version = "0.32.0", features = ["serde", "std"] }
 home = "0.5.5"
 url = "2.3"
-utoipa = "4"
-utoipa-swagger-ui = { version = "4", features = ["axum"] }
\ No newline at end of file
+utoipa = { version = "4", optional = true }
+utoipa-swagger-ui = { version = "4", features = ["axum"], optional = true }
+
+[features]
+swagger = ["cdk-axum/swagger", "dep:utoipa", "dep:utoipa-swagger-ui"]
\ No newline at end of file
diff --git a/crates/cdk-mintd/src/main.rs b/crates/cdk-mintd/src/main.rs
index 7947ef136..6f3c4c9f5 100644
--- a/crates/cdk-mintd/src/main.rs
+++ b/crates/cdk-mintd/src/main.rs
@@ -36,8 +36,6 @@ use tokio::sync::{Mutex, Notify};
 use tower_http::cors::CorsLayer;
 use tracing_subscriber::EnvFilter;
 use url::Url;
-use utoipa::OpenApi;
-use utoipa_swagger_ui::SwaggerUi;
 
 mod cli;
 mod config;
@@ -474,13 +472,17 @@ async fn main() -> anyhow::Result<()> {
     let v1_service = cdk_axum::create_mint_router(Arc::clone(&mint), cache_ttl, cache_tti).await?;
 
     let mut mint_service = Router::new()
-        .merge(
-            SwaggerUi::new("/swagger-ui")
-                .url("/api-docs/openapi.json", cdk_axum::ApiDocV1::openapi()),
-        )
         .merge(v1_service)
         .layer(CorsLayer::permissive());
 
+    #[cfg(feature = "swagger")]
+    {
+        mint_service = mint_service.merge(
+            utoipa_swagger_ui::SwaggerUi::new("/swagger-ui")
+                .url("/api-docs/openapi.json", cdk_axum::ApiDocV1::openapi()),
+        );
+    }
+
     for router in ln_routers {
         mint_service = mint_service.merge(router);
     }
diff --git a/crates/cdk/Cargo.toml b/crates/cdk/Cargo.toml
index ae935d79a..b72e50d23 100644
--- a/crates/cdk/Cargo.toml
+++ b/crates/cdk/Cargo.toml
@@ -12,7 +12,8 @@ license = "MIT"
 
 [features]
 default = ["mint", "wallet"]
-mint = ["dep:futures", "dep:utoipa"]
+mint = ["dep:futures"]
+swagger = ["mint", "dep:utoipa"]
 wallet = ["dep:reqwest"]
 bench = []
 
diff --git a/crates/cdk/src/amount.rs b/crates/cdk/src/amount.rs
index c612d570f..d2c599d04 100644
--- a/crates/cdk/src/amount.rs
+++ b/crates/cdk/src/amount.rs
@@ -27,7 +27,7 @@ pub enum Error {
 
 /// Amount can be any unit
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 #[serde(transparent)]
 pub struct Amount(u64);
 
diff --git a/crates/cdk/src/error.rs b/crates/cdk/src/error.rs
index 2aec8513c..5ca14821b 100644
--- a/crates/cdk/src/error.rs
+++ b/crates/cdk/src/error.rs
@@ -244,7 +244,7 @@ pub enum Error {
 ///
 /// See NUT definition in [00](https://github.com/cashubtc/nuts/blob/main/00.md)
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct ErrorResponse {
     /// Error Code
     pub code: ErrorCode,
@@ -400,7 +400,7 @@ impl From<ErrorResponse> for Error {
 
 /// Possible Error Codes
 #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub enum ErrorCode {
     /// Token is already spent
     TokenAlreadySpent,
diff --git a/crates/cdk/src/nuts/nut00/mod.rs b/crates/cdk/src/nuts/nut00/mod.rs
index f340328fd..57117bf01 100644
--- a/crates/cdk/src/nuts/nut00/mod.rs
+++ b/crates/cdk/src/nuts/nut00/mod.rs
@@ -103,7 +103,7 @@ pub enum Error {
 
 /// Blinded Message (also called `output`)
 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct BlindedMessage {
     /// Amount
     ///
@@ -118,7 +118,7 @@ pub struct BlindedMessage {
     ///
     /// The blinded secret message generated by the sender.
     #[serde(rename = "B_")]
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub blinded_secret: PublicKey,
     /// Witness
     ///
@@ -148,7 +148,7 @@ impl BlindedMessage {
 
 /// Blind Signature (also called `promise`)
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct BlindSignature {
     /// Amount
     ///
@@ -163,7 +163,7 @@ pub struct BlindSignature {
     ///
     /// The blinded signature on the secret message `B_` of [BlindedMessage].
     #[serde(rename = "C_")]
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub c: PublicKey,
     /// DLEQ Proof
     ///
@@ -187,7 +187,7 @@ impl PartialOrd for BlindSignature {
 /// Witness
 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
 #[serde(untagged)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub enum Witness {
     /// P2PK Witness
     #[serde(with = "serde_p2pk_witness")]
@@ -231,7 +231,7 @@ impl Witness {
 
 /// Proofs
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct Proof {
     /// Amount
     pub amount: Amount,
@@ -239,11 +239,11 @@ pub struct Proof {
     #[serde(rename = "id")]
     pub keyset_id: Id,
     /// Secret message
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub secret: Secret,
     /// Unblinded signature
     #[serde(rename = "C")]
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub c: PublicKey,
     /// Witness
     #[serde(skip_serializing_if = "Option::is_none")]
@@ -368,7 +368,7 @@ where
 /// Currency Unit
 #[non_exhaustive]
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Default)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub enum CurrencyUnit {
     /// Sat
     #[default]
@@ -445,7 +445,7 @@ impl<'de> Deserialize<'de> for CurrencyUnit {
 /// Payment Method
 #[non_exhaustive]
 #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub enum PaymentMethod {
     /// Bolt11 payment type
     #[default]
diff --git a/crates/cdk/src/nuts/nut01/mod.rs b/crates/cdk/src/nuts/nut01/mod.rs
index ce2e1b554..bda245fd4 100644
--- a/crates/cdk/src/nuts/nut01/mod.rs
+++ b/crates/cdk/src/nuts/nut01/mod.rs
@@ -43,7 +43,7 @@ pub enum Error {
 ///
 /// See [NUT-01]
 #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct Keys(BTreeMap<AmountStr, PublicKey>);
 
 impl From<MintKeys> for Keys {
@@ -86,7 +86,7 @@ impl Keys {
 /// Mint Public Keys [NUT-01]
 #[serde_as]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct KeysResponse {
     /// Keysets
     #[serde_as(as = "VecSkipError<_>")]
diff --git a/crates/cdk/src/nuts/nut01/public_key.rs b/crates/cdk/src/nuts/nut01/public_key.rs
index d78457227..23e2f1dee 100644
--- a/crates/cdk/src/nuts/nut01/public_key.rs
+++ b/crates/cdk/src/nuts/nut01/public_key.rs
@@ -13,9 +13,9 @@ use crate::SECP256K1;
 
 /// PublicKey
 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct PublicKey {
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     inner: secp256k1::PublicKey,
 }
 
diff --git a/crates/cdk/src/nuts/nut01/secret_key.rs b/crates/cdk/src/nuts/nut01/secret_key.rs
index 58cd81f43..23eca6e34 100644
--- a/crates/cdk/src/nuts/nut01/secret_key.rs
+++ b/crates/cdk/src/nuts/nut01/secret_key.rs
@@ -15,9 +15,9 @@ use crate::SECP256K1;
 
 /// SecretKey
 #[derive(Debug, Clone, PartialEq, Eq)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct SecretKey {
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     inner: secp256k1::SecretKey,
 }
 
diff --git a/crates/cdk/src/nuts/nut02.rs b/crates/cdk/src/nuts/nut02.rs
index 53aa58d09..32e961909 100644
--- a/crates/cdk/src/nuts/nut02.rs
+++ b/crates/cdk/src/nuts/nut02.rs
@@ -53,7 +53,7 @@ pub enum Error {
 
 /// Keyset version
 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub enum KeySetVersion {
     /// Current Version 00
     Version00,
@@ -89,7 +89,7 @@ impl fmt::Display for KeySetVersion {
 /// be stored in a Cashu token such that the token can be used to identify
 /// which mint or keyset it was generated from.
 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct Id {
     version: KeySetVersion,
     id: [u8; Self::BYTELEN],
@@ -230,7 +230,7 @@ impl From<&Keys> for Id {
 /// Ids of mints keyset ids
 #[serde_as]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct KeysetResponse {
     /// set of public key ids that the mint generates
     #[serde_as(as = "VecSkipError<_>")]
@@ -239,7 +239,7 @@ pub struct KeysetResponse {
 
 /// Keyset
 #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct KeySet {
     /// Keyset [`Id`]
     pub id: Id,
@@ -275,7 +275,7 @@ impl From<MintKeySet> for KeySet {
 
 /// KeySetInfo
 #[derive(Debug, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct KeySetInfo {
     /// Keyset [`Id`]
     pub id: Id,
diff --git a/crates/cdk/src/nuts/nut03.rs b/crates/cdk/src/nuts/nut03.rs
index 101a0f578..535c89a9e 100644
--- a/crates/cdk/src/nuts/nut03.rs
+++ b/crates/cdk/src/nuts/nut03.rs
@@ -34,10 +34,10 @@ pub struct PreSwap {
 
 /// Split Request [NUT-06]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct SwapRequest {
     /// Proofs that are to be spent in `Split`
-    #[cfg_attr(feature = "mint", schema(value_type = Vec<Proof>))]
+    #[cfg_attr(feature = "swagger", schema(value_type = Vec<Proof>))]
     pub inputs: Proofs,
     /// Blinded Messages for Mint to sign
     pub outputs: Vec<BlindedMessage>,
@@ -66,7 +66,7 @@ impl SwapRequest {
 
 /// Split Response [NUT-06]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct SwapResponse {
     /// Promises
     pub signatures: Vec<BlindSignature>,
diff --git a/crates/cdk/src/nuts/nut04.rs b/crates/cdk/src/nuts/nut04.rs
index 008c8dd68..3067628f6 100644
--- a/crates/cdk/src/nuts/nut04.rs
+++ b/crates/cdk/src/nuts/nut04.rs
@@ -26,7 +26,7 @@ pub enum Error {
 
 /// Mint quote request [NUT-04]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintQuoteBolt11Request {
     /// Amount
     pub amount: Amount,
@@ -39,7 +39,7 @@ pub struct MintQuoteBolt11Request {
 /// Possible states of a quote
 #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Default, Serialize, Deserialize)]
 #[serde(rename_all = "UPPERCASE")]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema), schema(as = MintQuoteState))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema), schema(as = MintQuoteState))]
 pub enum QuoteState {
     /// Quote has not been paid
     #[default]
@@ -81,7 +81,7 @@ impl FromStr for QuoteState {
 
 /// Mint quote response [NUT-04]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintQuoteBolt11Response {
     /// Quote Id
     pub quote: String,
@@ -178,13 +178,13 @@ impl From<crate::mint::MintQuote> for MintQuoteBolt11Response {
 
 /// Mint request [NUT-04]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintBolt11Request {
     /// Quote id
-    #[cfg_attr(feature = "mint", schema(max_length = 1_000))]
+    #[cfg_attr(feature = "swagger", schema(max_length = 1_000))]
     pub quote: String,
     /// Outputs
-    #[cfg_attr(feature = "mint", schema(max_items = 1_000))]
+    #[cfg_attr(feature = "swagger", schema(max_items = 1_000))]
     pub outputs: Vec<BlindedMessage>,
 }
 
@@ -202,7 +202,7 @@ impl MintBolt11Request {
 
 /// Mint response [NUT-04]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintBolt11Response {
     /// Blinded Signatures
     pub signatures: Vec<BlindSignature>,
@@ -210,7 +210,7 @@ pub struct MintBolt11Response {
 
 /// Mint Method Settings
 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintMethodSettings {
     /// Payment Method e.g. bolt11
     pub method: PaymentMethod,
@@ -229,7 +229,7 @@ pub struct MintMethodSettings {
 
 /// Mint Settings
 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema), schema(as = nut04::Settings))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema), schema(as = nut04::Settings))]
 pub struct Settings {
     /// Methods to mint
     pub methods: Vec<MintMethodSettings>,
diff --git a/crates/cdk/src/nuts/nut05.rs b/crates/cdk/src/nuts/nut05.rs
index 2462272d0..e7ac3153a 100644
--- a/crates/cdk/src/nuts/nut05.rs
+++ b/crates/cdk/src/nuts/nut05.rs
@@ -29,10 +29,10 @@ pub enum Error {
 
 /// Melt quote request [NUT-05]
 #[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MeltQuoteBolt11Request {
     /// Bolt11 invoice to be paid
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub request: Bolt11Invoice,
     /// Unit wallet would like to pay with
     pub unit: CurrencyUnit,
@@ -43,7 +43,7 @@ pub struct MeltQuoteBolt11Request {
 /// Possible states of a quote
 #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Default, Serialize, Deserialize)]
 #[serde(rename_all = "UPPERCASE")]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema), schema(as = MeltQuoteState))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema), schema(as = MeltQuoteState))]
 pub enum QuoteState {
     /// Quote has not been paid
     #[default]
@@ -87,7 +87,7 @@ impl FromStr for QuoteState {
 
 /// Melt quote response [NUT-05]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MeltQuoteBolt11Response {
     /// Quote Id
     pub quote: String,
@@ -214,12 +214,12 @@ impl From<mint::MeltQuote> for MeltQuoteBolt11Response {
 
 /// Melt Bolt11 Request [NUT-05]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MeltBolt11Request {
     /// Quote ID
     pub quote: String,
     /// Proofs
-    #[cfg_attr(feature = "mint", schema(value_type = Vec<Proof>))]
+    #[cfg_attr(feature = "swagger", schema(value_type = Vec<Proof>))]
     pub inputs: Proofs,
     /// Blinded Message that can be used to return change [NUT-08]
     /// Amount field of BlindedMessages `SHOULD` be set to zero
@@ -236,7 +236,7 @@ impl MeltBolt11Request {
 
 /// Melt Method Settings
 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MeltMethodSettings {
     /// Payment Method e.g. bolt11
     pub method: PaymentMethod,
@@ -274,7 +274,7 @@ impl Settings {
 
 /// Melt Settings
 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema), schema(as = nut05::Settings))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema), schema(as = nut05::Settings))]
 pub struct Settings {
     /// Methods to melt
     pub methods: Vec<MeltMethodSettings>,
diff --git a/crates/cdk/src/nuts/nut06.rs b/crates/cdk/src/nuts/nut06.rs
index afb8b8f82..358cc4ff4 100644
--- a/crates/cdk/src/nuts/nut06.rs
+++ b/crates/cdk/src/nuts/nut06.rs
@@ -9,7 +9,7 @@ use super::{nut04, nut05, nut15, MppMethodSettings};
 
 /// Mint Version
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintVersion {
     /// Mint Software name
     pub name: String,
@@ -53,7 +53,7 @@ impl<'de> Deserialize<'de> for MintVersion {
 
 /// Mint Info [NIP-06]
 #[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MintInfo {
     /// name of the mint and should be recognizable
     #[serde(skip_serializing_if = "Option::is_none")]
@@ -190,7 +190,7 @@ impl MintInfo {
 
 /// Supported nuts and settings
 #[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct Nuts {
     /// NUT04 Settings
     #[serde(default)]
@@ -325,14 +325,14 @@ impl Nuts {
 
 /// Check state Settings
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct SupportedSettings {
     supported: bool,
 }
 
 /// Contact Info
 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct ContactInfo {
     /// Contact Method i.e. nostr
     pub method: String,
diff --git a/crates/cdk/src/nuts/nut07.rs b/crates/cdk/src/nuts/nut07.rs
index a8a739502..b56830ea1 100644
--- a/crates/cdk/src/nuts/nut07.rs
+++ b/crates/cdk/src/nuts/nut07.rs
@@ -21,7 +21,7 @@ pub enum Error {
 /// State of Proof
 #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Serialize, Deserialize)]
 #[serde(rename_all = "UPPERCASE")]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub enum State {
     /// Spent
     Spent,
@@ -66,21 +66,21 @@ impl FromStr for State {
 
 /// Check spendable request [NUT-07]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct CheckStateRequest {
     /// Y's of the proofs to check
     #[serde(rename = "Ys")]
-    #[cfg_attr(feature = "mint", schema(value_type = Vec<String>, max_items = 1_000))]
+    #[cfg_attr(feature = "swagger", schema(value_type = Vec<String>, max_items = 1_000))]
     pub ys: Vec<PublicKey>,
 }
 
 /// Proof state [NUT-07]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct ProofState {
     /// Y of proof
     #[serde(rename = "Y")]
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub y: PublicKey,
     /// State of proof
     pub state: State,
@@ -90,7 +90,7 @@ pub struct ProofState {
 
 /// Check Spendable Response [NUT-07]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct CheckStateResponse {
     /// Proof states
     pub states: Vec<ProofState>,
diff --git a/crates/cdk/src/nuts/nut09.rs b/crates/cdk/src/nuts/nut09.rs
index 74d92915d..abcd8f85a 100644
--- a/crates/cdk/src/nuts/nut09.rs
+++ b/crates/cdk/src/nuts/nut09.rs
@@ -8,7 +8,7 @@ use super::nut00::{BlindSignature, BlindedMessage};
 
 /// Restore Request [NUT-09]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct RestoreRequest {
     /// Outputs
     pub outputs: Vec<BlindedMessage>,
@@ -16,7 +16,7 @@ pub struct RestoreRequest {
 
 /// Restore Response [NUT-09]
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct RestoreResponse {
     /// Outputs
     pub outputs: Vec<BlindedMessage>,
diff --git a/crates/cdk/src/nuts/nut11/mod.rs b/crates/cdk/src/nuts/nut11/mod.rs
index dbebbe599..6d407e2b1 100644
--- a/crates/cdk/src/nuts/nut11/mod.rs
+++ b/crates/cdk/src/nuts/nut11/mod.rs
@@ -88,7 +88,7 @@ pub enum Error {
 
 /// P2Pk Witness
 #[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct P2PKWitness {
     /// Signatures
     pub signatures: Vec<String>,
diff --git a/crates/cdk/src/nuts/nut12.rs b/crates/cdk/src/nuts/nut12.rs
index 368879dda..232368b04 100644
--- a/crates/cdk/src/nuts/nut12.rs
+++ b/crates/cdk/src/nuts/nut12.rs
@@ -41,13 +41,13 @@ pub enum Error {
 ///
 /// Defined in [NUT12](https://github.com/cashubtc/nuts/blob/main/12.md)
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct BlindSignatureDleq {
     /// e
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub e: SecretKey,
     /// s
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub s: SecretKey,
 }
 
@@ -55,16 +55,16 @@ pub struct BlindSignatureDleq {
 ///
 /// Defined in [NUT12](https://github.com/cashubtc/nuts/blob/main/12.md)
 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct ProofDleq {
     /// e
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub e: SecretKey,
     /// s
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub s: SecretKey,
     /// Blinding factor
-    #[cfg_attr(feature = "mint", schema(value_type = String))]
+    #[cfg_attr(feature = "swagger", schema(value_type = String))]
     pub r: SecretKey,
 }
 
diff --git a/crates/cdk/src/nuts/nut14/mod.rs b/crates/cdk/src/nuts/nut14/mod.rs
index f35d5400b..07da54dc4 100644
--- a/crates/cdk/src/nuts/nut14/mod.rs
+++ b/crates/cdk/src/nuts/nut14/mod.rs
@@ -52,7 +52,7 @@ pub enum Error {
 
 /// HTLC Witness
 #[derive(Default, Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct HTLCWitness {
     /// Primage
     pub preimage: String,
diff --git a/crates/cdk/src/nuts/nut15.rs b/crates/cdk/src/nuts/nut15.rs
index e918ff084..abaa5c422 100644
--- a/crates/cdk/src/nuts/nut15.rs
+++ b/crates/cdk/src/nuts/nut15.rs
@@ -10,7 +10,7 @@ use crate::Amount;
 /// Multi-part payment
 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
 #[serde(rename = "lowercase")]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct Mpp {
     /// Amount
     pub amount: Amount,
@@ -18,7 +18,7 @@ pub struct Mpp {
 
 /// Mpp Method Settings
 #[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema))]
 pub struct MppMethodSettings {
     /// Payment Method e.g. bolt11
     pub method: PaymentMethod,
@@ -30,7 +30,7 @@ pub struct MppMethodSettings {
 
 /// Mpp Settings
 #[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
-#[cfg_attr(feature = "mint", derive(utoipa::ToSchema), schema(as = nut15::Settings))]
+#[cfg_attr(feature = "swagger", derive(utoipa::ToSchema), schema(as = nut15::Settings))]
 pub struct Settings {
     /// Method settings
     pub methods: Vec<MppMethodSettings>,