Skip to content

Commit

Permalink
BrpQueryRow has field deserialization fix (#16613)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
Leinnan authored Dec 4, 2024
1 parent 7dfc77b commit f59ae0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_remote/src/builtin_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ pub struct BrpQueryRow {
pub components: HashMap<String, Value>,

/// The boolean-only containment query results.
#[serde(skip_serializing_if = "HashMap::is_empty")]
#[serde(skip_serializing_if = "HashMap::is_empty", default)]
pub has: HashMap<String, Value>,
}

Expand Down

0 comments on commit f59ae0f

Please sign in to comment.