A worked example, rendered from real sample data. Sign in to run the tool on your own input.
{"id":1,"name":"ferris","crabby":true,"stars":1000}use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct Root {
pub id: i64,
pub name: String,
pub crabby: bool,
pub stars: i64,
}
Generate a serde-compatible Rust struct from a JSON sample. Part of the DevTools Surf developer suite. Browse more tools in the Converters collection.