From 21cd90f238160701e2a562c1965c4d3e53ab88d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Mon, 22 Jul 2024 13:54:47 +0200 Subject: [PATCH] Default construct NodeRole for backwards compatibility --- nym-api/nym-api-requests/src/models.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nym-api/nym-api-requests/src/models.rs b/nym-api/nym-api-requests/src/models.rs index 54781cf603..05cf9f702e 100644 --- a/nym-api/nym-api-requests/src/models.rs +++ b/nym-api/nym-api-requests/src/models.rs @@ -612,9 +612,15 @@ pub struct NymNodeDescription { // for now we only care about their ws/wss situation, nothing more pub mixnet_websockets: WebSockets, + #[serde(default = "default_node_role")] pub role: NodeRole, } +// For backwards compatibility, set a slightly artificial default +fn default_node_role() -> NodeRole { + NodeRole::Inactive +} + #[derive(Clone, Debug, Serialize, Deserialize, schemars::JsonSchema)] pub struct DescribedGateway { pub bond: GatewayBond,