| ⚡ Parallel pipeline | Files are read and parsed in parallel with rayon |
| 🧠 Auto-schema detection | Objects → deep merge, arrays → concat, mixed → helpful error |
| 🥊 Conflict resolution | Ranked coercion (object > array > string > number > bool > null) or --strict |
| 🔤 Stable key order | IndexMap preserves insertion order across merges |
| 📦 Single binary | Zero runtime dependencies |
# straight from this repo
cargo install --git https://github.com/suggydev/json-rollup
# or from source
git clone https://github.com/suggydev/json-rollup && cd json-rollup
cargo build --release # → target/release/json-rollup# try it on the bundled examples
json-rollup ./examples --out merged.json
# deep-merge every .json in ./data (recursive)
json-rollup ./data --out merged.json
# force array concatenation / object deep-merge
json-rollup ./data --array --out all.json
json-rollup ./data --object --out combined.json
# fail loudly on type conflicts instead of coercing
json-rollup ./data --strict --out merged.jsonexamples/users-1.json + examples/users-2.json merge into:
{
"app": "rollup-demo",
"tags": ["a", "b", "c"],
"limits": { "rps": 100, "burst": 20 },
"debug": false,
"owner": "suggy"
}- Collect — recursively walks input paths for
.jsonfiles (walkdir). - Parse — every file parsed in parallel (
rayon+serde_json). - Infer — all objects → deep merge; all arrays → concat; mixed → error with a hint.
- Merge — nested objects merge recursively, arrays concatenate, scalars: later wins; type conflicts resolve by rank or fail under
--strict.
cargo test # 8 unit tests (merger, schema)
cargo clippy # lintsMIT — see LICENSE.