From f59ae0f5e8f7fcb4ba6488b361706399a990ec63 Mon Sep 17 00:00:00 2001 From: MevLyshkin Date: Wed, 4 Dec 2024 19:26:33 +0100 Subject: [PATCH] BrpQueryRow has field deserialization fix (#16613) # Objective BrpQueryRow doesn't serialize `has` field if it is empty. That is okay until you try to deserialize it after. Then it will fail to deserialize due to missing field. ## Solution Serde support using default value when field is missing, this PR adds that. --- crates/bevy_remote/src/builtin_methods.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_remote/src/builtin_methods.rs b/crates/bevy_remote/src/builtin_methods.rs index 08458da1c02cf..a3c38e8c3d379 100644 --- a/crates/bevy_remote/src/builtin_methods.rs +++ b/crates/bevy_remote/src/builtin_methods.rs @@ -304,7 +304,7 @@ pub struct BrpQueryRow { pub components: HashMap, /// The boolean-only containment query results. - #[serde(skip_serializing_if = "HashMap::is_empty")] + #[serde(skip_serializing_if = "HashMap::is_empty", default)] pub has: HashMap, }