Skip serializing None value for room_type fields

This commit is contained in:
Jonas Platte 2022-08-17 19:12:43 +02:00 committed by Jonas Platte
parent 23a608788b
commit 2b4ac40981
2 changed files with 3 additions and 0 deletions

View File

@ -70,6 +70,7 @@ pub struct SpaceHierarchyRoomsChunk {
pub join_rule: SpaceRoomJoinRule,
/// The type of room from `m.room.create`, if any.
#[serde(skip_serializing_if = "Option::is_none")]
pub room_type: Option<RoomType>,
/// The stripped `m.space.child` events of the space-room.

View File

@ -62,6 +62,7 @@ pub struct SpaceHierarchyParentSummary {
pub join_rule: PublicRoomJoinRule,
/// The type of room from `m.room.create`, if any.
#[serde(skip_serializing_if = "Option::is_none")]
pub room_type: Option<RoomType>,
/// The stripped `m.space.child` events of the space-room.
@ -191,6 +192,7 @@ pub struct SpaceHierarchyChildSummary {
pub join_rule: PublicRoomJoinRule,
/// The type of room from `m.room.create`, if any.
#[serde(skip_serializing_if = "Option::is_none")]
pub room_type: Option<RoomType>,
/// If the room is a restricted room, these are the room IDs which are specified by the join