Skip to content

Commit

Permalink
Object metric (Rust): Use vec helper function to deserialize empty ve…
Browse files Browse the repository at this point in the history
…c from null
  • Loading branch information
badboy committed Aug 5, 2024
1 parent b253e03 commit f554043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glean_parser/templates/rust.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Jinja2 template is not. Please file bugs! #}
pub struct {{ name }} {
{% for itemname, val in struct.properties.items() %}
{% if val.type == "array" %}
#[serde(skip_serializing_if = "Vec::is_empty", default = "Vec::new")]
#[serde(skip_serializing_if = "Vec::is_empty", default = "Vec::new", deserialize_with = "::glean::traits::__serde_helper::vec_null")]
pub {{itemname|snake_case}}: {{ name ~ itemname|Camelize }},
{% elif val.type == "object" %}
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit f554043

Please sign in to comment.