Skip to content

Commit

Permalink
fix(ws): serialize i64/u64 to string
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulrahman1s committed Jun 27, 2022
1 parent 158284f commit b6af0ff
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/gateway/payload.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down

0 comments on commit b6af0ff

Please sign in to comment.