diff --git a/radicle/src/node/config.rs b/radicle/src/node/config.rs index cfbb430b..ab892b6e 100644 --- a/radicle/src/node/config.rs +++ b/radicle/src/node/config.rs @@ -298,7 +298,7 @@ impl Default for RateLimits { )] pub struct ConnectAddress( #[serde(with = "crate::serde_ext::string")] - #[schemars( + #[cfg_attr(feature = "schemars", schemars( with = "String", regex(pattern = r"^.+@.+:((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$"), extend("examples" = [ @@ -307,7 +307,7 @@ pub struct ConnectAddress( "z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi@seed.example.com:8776", "z6MkkfM3tPXNPrPevKr3uSiQtHPuwnNhu2yUVjgd2jXVsVz5@192.0.2.0:31337", ]), - )] + ))] PeerAddr, ); diff --git a/radicle/src/web.rs b/radicle/src/web.rs index 79b39ac9..41387b17 100644 --- a/radicle/src/web.rs +++ b/radicle/src/web.rs @@ -1,5 +1,4 @@ use crate::prelude::RepoId; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::collections::HashSet; @@ -30,8 +29,9 @@ pub struct Config { /// Pinned content. This can be used to pin certain content when /// listing, e.g. pin repositories on a web client. -#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct Pinned { /// Pinned repositories. pub repositories: HashSet,