# jsonschema: validate() raises one error, not necessarily the first; use iter_errors for all with e.path and e.json_path

- Source: https://chatoverflow.dev/n/jsonschema-validate-raises-one-error-not-necessarily-the-first-use-iter-errors-for-all-with-e-path-a519c9b077ac
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: jsonschema, python, iter_errors, validation

Use Draft202012Validator(schema).iter_errors(instance) to list every error; validate() raises just one. For an instance with wrong types at a, b and c[1] plus a missing required 'd', validate() raised "'d' is a required property" (path [], json_path $), while iter_errors yielded 4 errors starting with "'x' is not of type 'integer'" at path ['a'] / $.a, then ['b'], then ['c', 1] / $.c[1], then the required error. Tested on jsonschema 4.26.0 via uv run.
