JSON to YAML
Convert JSON to clean, correctly quoted YAML in one step.
Rebuild nested JSON from flat dot-notation or bracket-notation keys.
Bracket notation is understood automatically, whatever this is set to.
The JSON Unflattener rebuilds nested JSON from a flat object of path keys. Numeric path segments become array indexes and everything else becomes an object key, and it reads dot notation, bracket notation or a mixture of the two.
Unflattening is the inverse of flattening: a single-level object whose keys are paths becomes a properly nested document. The key "user.address.city" creates the objects it names, and a numeric segment such as "items.0.sku" creates an array rather than an object.
It is the step that turns machine-friendly storage back into something an API will accept. Flat keys are how environment files, spreadsheet columns, form posts and key-value stores hold structured data, and every one of those eventually has to be sent somewhere that expects real nesting. The parser accepts dot notation, bracket notation and a document that mixes the two, which hand-edited config files frequently do.
A numeric path segment produces a real array, so items.0.sku comes back as a list of objects rather than an object with "0" as a key.
Dot and bracket keys are both understood, including a document that mixes them — which hand-edited config files routinely do.
Match whatever character your keys were joined with, so the round trip through the Flattener is lossless.
Paths of any length rebuild correctly; the structure is created level by level as each key is read.
The rebuilt document is indented and ready to send, not returned as one line.
A single-level object whose keys are paths, in dot or bracket notation.
Leave it as a dot, or change it if your keys are joined with underscores or slashes.
Numeric segments become array indexes; everything else becomes an object key.
The nested document is formatted and ready to send.
By the path segment. A segment made only of digits creates an array index; anything else creates an object key. So items.0.sku produces an array of objects.
Yes, and it can read a document that mixes both forms. user[address].city and user.address.city produce the same result.
Change the separator to a character your keys do not use — an underscore, a slash or a pipe — and flatten with the same setting so the round trip stays exact.
Missing indexes are dropped rather than filled with nulls, so 0 and 2 produce a two-item array. Provide every index when the positions matter.
What people who use the JSON Unflattener think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON Unflattener. It takes half a minute and no account.
Write the first reviewConvert JSON to clean, correctly quoted YAML in one step.
Build and sign a JWT with HS256, HS384 or HS512 for testing.
Generate serde-ready Rust structs from a sample JSON document.
Find what runs on a port, with a note on whether it should be exposed.
Turn a JSON object into a TOML document with proper tables and arrays of tables.
Run XPath expressions against your own XML and see every node that matches.
Generate C# classes with System.Text.Json attributes from a JSON sample.
Sort JSON object keys alphabetically at every level, or sort arrays by a field.