Added default null to clientmessage
This commit is contained in:
parent
5fbaaa78b1
commit
5dc72469a7
|
@ -6,6 +6,10 @@ use serde_json::Value;
|
|||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ClientMessage {
|
||||
pub head: String,
|
||||
#[serde(skip_serializing_if = "Value::is_null")]
|
||||
#[serde(skip_serializing_if = "Value::is_null", default = "null_value")]
|
||||
pub body: Value,
|
||||
}
|
||||
|
||||
fn null_value() -> Value {
|
||||
Value::Null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue