How to create file extension json

Hello everyone
I need help for create file .JSON extension in rust, which function i can use or what practice good i can use.
Thank you so much

It's not clear to me what you need. Do you have some data that you want to store to disk formatted as JSON?

Use Path::with_extension:

use std::path::PathBuf;

fn main() {
    let path: PathBuf = "/foo/bar".into();
    let json = path.with_extension("json");
    dbg!(json);
}

I want store data in file .JSON

Thank you very much, me helped with solution