From 1de11da61a106187748c4b79e1d7b63e3b9d172f Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Dec 2026 01:16:49 +0000 Subject: The Swagger UI is a feature, swagger-ui, and not among most Its files were built into every node, some megabytes of each binary, and its build fetches them from GitHub. A build that is to serve /swagger-ui names the feature; /openapi.yaml is served as before. Development builds (most) leave it out. --- Cargo.toml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index f970ab9..93046a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,8 +42,12 @@ tor = [ "dep:tor-rtcompat", "dep:safelog", ] -# Every feature above but tokio-console, for development: builds, checks and tests with -# one set of features don't rebuild what another set built. Not a default. +# The Swagger UI showing the API (`/swagger-ui`): its files are built into the node. +# Without it, the node serves the description alone (`/openapi.yaml`). +swagger-ui = ["dep:utoipa-swagger-ui"] +# Every feature above but tokio-console and swagger-ui, for development: builds, checks +# and tests with one set of features don't rebuild what another set built. Not a +# default. most = ["dashboard", "federation", "libp2p", "mycelium", "tor"] [dependencies] @@ -102,7 +106,7 @@ tokio = { version = "1.53", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } url = "2.5" -utoipa-swagger-ui = { version = "10", features = ["axum"] } +utoipa-swagger-ui = { version = "10", features = ["axum"], optional = true } uuid = { version = "1", features = ["v4"] } # A quick development loop (docs/development.md): line numbers in backtraces but no -- cgit v1.3.1