From b79b6e575cb95266fbcc69f6e5275da3161c2c3c Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 10 Apr 2023 14:08:50 -0700 Subject: [PATCH] accumulate foreign_members on feature collection --- src/feature_collection.rs | 1 + tests/roundtrip.rs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/feature_collection.rs b/src/feature_collection.rs index 6a9fc33..5bd28ca 100644 --- a/src/feature_collection.rs +++ b/src/feature_collection.rs @@ -71,6 +71,7 @@ pub struct FeatureCollection { /// Foreign Members /// /// [GeoJSON Format Specification ยง 6](https://tools.ietf.org/html/rfc7946#section-6) + #[serde(flatten)] pub foreign_members: Option, } diff --git a/tests/roundtrip.rs b/tests/roundtrip.rs index 12eb7ec..c4a7687 100644 --- a/tests/roundtrip.rs +++ b/tests/roundtrip.rs @@ -63,6 +63,12 @@ mod roundtrip_tests { let original_json: serde_json::Value = serde_json::from_str(&file_contents).unwrap(); let roundtrip_json: serde_json::Value = serde_json::from_str(&geojson_string).unwrap(); - assert_eq!(original_json, roundtrip_json) + assert_eq!( + original_json, + roundtrip_json, + "inconsistent round trip: {file_path}. \n\n original: {} \n\n roundtrip: {}", + serde_json::to_string_pretty(&original_json).unwrap(), + serde_json::to_string_pretty(&roundtrip_json).unwrap() + ); } }