#How do I modify Json files the correct way with serde_json?
1 messages · Page 1 of 1 (latest)
You need to read the entire file, then write a replacement.
And you'll need a structure like
#[derive(Deserialize, Serialize)]
struct Container {
person: Vec<Person>,
}
to match the outer part of the JSON
(And there shouldn't be any serde_json::Value involved — it doesn't help here.)