JSON

JSON Flatten and Unflatten

Flatten nested properties into addressable paths or rebuild a document from a pointer map.

How this tool works

JSON Pointer escapes slashes and tildes in member names, avoiding ambiguous dot paths. Empty containers remain explicit values so a supported document can round trip.

Unflatten rejects duplicate parent/child paths and sparse arrays. Pointer maps should be reviewed before using them as a persistent interchange format.

Examples

  • Flatten a nested API fixture.
  • Preserve a key containing a slash.
  • Reject a conflicting parent and child pointer.

Common use cases

Compare selected fixture leaves across nested documents.

Worked synthetic example

Valid example

{"a/b":{"id":2}}

Expected: {"/a~1b/id":2}. The slash in the member name is escaped to preserve the path boundary.

Failure or warning to recognize

Invalid/failure example

Pointer map with both /order and /order/id as leaf values.

Expected: Unflattening both /order and /order/id as leaf entries reports a parent/child pointer collision.

Related guides

Official references

Related tools

JSON Flatten and Unflatten: Map nested values to JSON Pointers | DevPouch