From 9c3905c7a5a93f78e722fff16993c05f60dac57b Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 10 Feb 2024 18:35:20 +0000 Subject: [PATCH] server: use default API version if not specified --- src/server.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server.rs b/src/server.rs index dcef0eb..05047c6 100644 --- a/src/server.rs +++ b/src/server.rs @@ -75,8 +75,13 @@ impl IntoResponse for ApiError { type ApiResult = Result; +fn default_api_version() -> String { + "4".to_owned() +} + #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] struct ApiVersion { + #[serde(default = "default_api_version")] api_version: String, }