Skip to content

Commit

Permalink
style: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed Jan 5, 2025
1 parent bd7e652 commit 475b343
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/utils/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ pub fn flatten_json_body(
validation_required: bool,
) -> Result<Value, anyhow::Error> {
// Flatten the json body only if new schema and has less than 4 levels of nesting
let mut nested_value = if schema_version == SchemaVersion::V0 || has_more_than_four_levels(&body, 1) {
body
} else {
let flattened_json = generic_flattening(&body)?;
convert_to_array(flattened_json)?
};
let mut nested_value =
if schema_version == SchemaVersion::V0 || has_more_than_four_levels(&body, 1) {
body
} else {
let flattened_json = generic_flattening(&body)?;
convert_to_array(flattened_json)?
};
flatten::flatten(
&mut nested_value,
"_",
Expand Down

0 comments on commit 475b343

Please sign in to comment.