Paste JSON and a Swift DecodingError string, and see exactly which node in the JSON tree caused the failure.
- Paste your JSON payload into the JSON field.
- Paste the output of
String(describing: error)for aDecodingErrorinto the DecodingError field. - The tree view highlights the node at the error's
codingPath. ForkeyNotFounderrors, the missing key is shown as a ghost entry.
Click any of the built-in examples to see it in action.
| Case | What it highlights |
|---|---|
typeMismatch |
The value that had the wrong type |
valueNotFound |
The null where a value was expected |
keyNotFound |
The parent object, with the missing key shown inline |
dataCorrupted |
The value that couldn't be parsed |
No build step required. Serve site/ with any static server:
python3 -m http.server -d sitebun tests/run.jsRequires Bun (Node's fetch doesn't support file:// URLs).
Tests can also be run in the browser by opening tests/index.html through a local server.
The fixtures/ directory is a Swift Package that produces real DecodingError strings by decoding intentionally malformed JSON. To regenerate:
cd fixtures && swift run Fixtures ../site/fixtures