From b6af0ff9cdcff018a38b910bf705aa057a38e592 Mon Sep 17 00:00:00 2001 From: Abdulrahman Salah Date: Mon, 27 Jun 2022 01:47:54 +0000 Subject: [PATCH] fix(ws): serialize i64/u64 to string --- src/gateway/payload.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gateway/payload.rs b/src/gateway/payload.rs index 8e5ff37..1c0c0e5 100644 --- a/src/gateway/payload.rs +++ b/src/gateway/payload.rs @@ -1,12 +1,22 @@ use crate::structures::*; +use crate::utils::snowflake; use axum::extract::ws; use serde::{Deserialize, Serialize}; +#[serde_as] #[derive(Serialize, Deserialize)] #[serde(untagged)] pub enum Empty { - Default { id: u64 }, - ServerObject { id: u64, server_id: u64 }, + Default { + #[serde_as(as = "snowflake::json::ID")] + id: u64, + }, + ServerObject { + #[serde_as(as = "snowflake::json::ID")] + id: u64, + #[serde_as(as = "snowflake::json::ID")] + server_id: u64, + }, } #[derive(Serialize, Deserialize)]