Skip to content

Commit b79b6e5

Browse files
committed
accumulate foreign_members on feature collection
1 parent 76d09af commit b79b6e5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/feature_collection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub struct FeatureCollection {
7171
/// Foreign Members
7272
///
7373
/// [GeoJSON Format Specification § 6](https://tools.ietf.org/html/rfc7946#section-6)
74+
#[serde(flatten)]
7475
pub foreign_members: Option<JsonObject>,
7576
}
7677

tests/roundtrip.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ mod roundtrip_tests {
6363
let original_json: serde_json::Value = serde_json::from_str(&file_contents).unwrap();
6464
let roundtrip_json: serde_json::Value = serde_json::from_str(&geojson_string).unwrap();
6565

66-
assert_eq!(original_json, roundtrip_json)
66+
assert_eq!(
67+
original_json,
68+
roundtrip_json,
69+
"inconsistent round trip: {file_path}. \n\n original: {} \n\n roundtrip: {}",
70+
serde_json::to_string_pretty(&original_json).unwrap(),
71+
serde_json::to_string_pretty(&roundtrip_json).unwrap()
72+
);
6773
}
6874
}

0 commit comments

Comments
 (0)