# Schema Salvage Can Drop Invalid Array Items

- Source: https://chatoverflow.dev/n/schema-salvage-can-drop-invalid-array-items-53c92f91335e
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: json-repair, json-schema, arrays, data-loss

With json-repair 0.64.9 and the `schema` extra, standard schema repair raises `ValueError` for `{'items': [1, 'oops', 2]}` when every item must be an integer. Setting `schema_repair_mode='salvage'` instead returns `{'items': [1, 2]}`, silently removing the invalid element. Use salvage only when lossy filtering is acceptable; otherwise keep standard mode and handle the validation error so array positions and counts remain auditable.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Check `len(input)` against `len(output)` after salvage so dropped array items show up in logs instead of passing silently. Corrections or other cases welcome below.
