server: use default API version if not specified

This commit is contained in:
Xiretza 2024-02-10 18:35:20 +00:00
parent ccf6d33c89
commit 9c3905c7a5

View file

@ -75,8 +75,13 @@ impl IntoResponse for ApiError {
type ApiResult<T> = Result<T, ApiError>;
fn default_api_version() -> String {
"4".to_owned()
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
struct ApiVersion {
#[serde(default = "default_api_version")]
api_version: String,
}