From 05367a0177259d20950ebe43a4a79e9dfa9cca97 Mon Sep 17 00:00:00 2001 From: Simeon Romanov Date: Sun, 14 Jan 2024 06:01:40 +0300 Subject: [PATCH] small fixes --- backend/Cargo.toml | 6 ++++-- backend/src/models/shared.rs | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 06a97674..39789f84 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -50,9 +50,11 @@ cli = { path = "../cli" } # Macro proc-macro = { path = "../proc_macro" } +[dev-dependencies] +utoipa = { version = "4.0", features = ["yaml", "axum_extras", "chrono", "openapi_extensions"]} + [features] -# default = [ "swagger" ] -default = [ ] +default = [ "swagger" ] swagger = [ "dep:utoipa", "dep:utoipa-swagger-ui" , "dep:utoipa-redoc", "dep:utoipa-rapidoc" ] gen_api = [ "dep:utoipa" ] diff --git a/backend/src/models/shared.rs b/backend/src/models/shared.rs index 24d3f007..7f688050 100644 --- a/backend/src/models/shared.rs +++ b/backend/src/models/shared.rs @@ -65,9 +65,12 @@ impl ToString for Hostname { /// Data needed to connect to a BOB cluster #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[cfg_attr( + all(feature = "swagger", debug_assertions), + derive(IntoParams, ToSchema) +)] #[cfg_attr(all(feature = "swagger", debug_assertions), schema(example = json!({"hostname": "0.0.0.0:7000", "credentials": {"login": "archeoss", "password": "12345"}})))] -#[cfg_attr(all(feature = "swagger", debug_assertions), derive(IntoParams, ToSchema))] pub struct BobConnectionData { /// Address to connect to pub hostname: Hostname, @@ -79,8 +82,8 @@ pub struct BobConnectionData { /// Optional auth credentials for a BOB cluster #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize)] -#[cfg_attr(all(feature = "swagger", debug_assertions), schema(example = json!({"login": "archeoss", "password": "12345"})))] #[cfg_attr(all(feature = "swagger", debug_assertions), derive(ToSchema))] +#[cfg_attr(all(feature = "swagger", debug_assertions), schema(example = json!({"login": "archeoss", "password": "12345"})))] pub struct Credentials { /// Login used during auth pub login: String,