Format preserving Json parser?

I'm looking for a format preserving json parser/writer. That is, I want to load a json document, do some edits to it and write it back out, without changing how the overall file is formatted.

This exists for toml in the form of toml_edit but I can't find anything like it for json/json5.

Does anyone know of a library/crate like this? I don't want to write my own one if I can avoid it.

I know that for serde deserialization there is the json_spanned_value crate, but that still leaves writing.
The crate itself doesn't seem to have been updated in a few years, and doesn't use the types in the serde_spanned crate it appears. Perhaps there is something more recent about, but that is the one I recall when I last looked into it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.