From 42c14e07c28b88b39efcb1a765937cc289643737 Mon Sep 17 00:00:00 2001 From: Ivan Rossier Date: Sat, 7 Jun 2025 23:44:30 +0200 Subject: [PATCH] fix(filters): ignore unknown filter variants during deserialization Binance added a new filter type (`POSITION_RISK_CONTROL`) which isn't recognized by the current enum in the `binance` crate, causing deserialization to fail. This patch updates the `Filters` enum to use `#[serde(other)]` to ignore unknown variants, preventing panics and improving compatibility with future changes in Binance's API. --- src/model.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/model.rs b/src/model.rs index baedc33f..88e42a68 100644 --- a/src/model.rs +++ b/src/model.rs @@ -124,6 +124,9 @@ pub enum Filters { min_trailing_below_delta: Option, max_trailing_below_delta: Option, }, + // Add this to catch unknown variants during deserialization + #[serde(other)] + Unknown, } #[derive(Debug, Serialize, Deserialize, Clone)]