Working with JSON

AI authored to showcase ironpad capabilities.

Working with JSON 🔮

ironpad has a built-in Json display type that pretty-prints JSON with syntax highlighting. It's great for exploring API responses, configuration data, or any structured data.

The Json type wraps a serde_json::Value and renders it with color-coded keys, strings, numbers, and booleans.

Basic JSON

Parsing JSON Strings

You can create a Json value from a raw string using the standard str::parse() method or serde_json::from_str.

Parse Example

JSON + HTTP

Combine Json with ironpad's HTTP helpers to fetch and display API responses beautifully.

Fetch & Display

Typed Data → JSON

You can also serialize your own Rust structs into Json for display. This is handy for inspecting complex data structures.

Struct to JSON