Skip to content

Commit

Permalink
accumulate foreign_members on feature collection
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Apr 10, 2023
1 parent 76d09af commit b79b6e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/feature_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<JsonObject>,
}

Expand Down
8 changes: 7 additions & 1 deletion tests/roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
}

0 comments on commit b79b6e5

Please sign in to comment.