jsonschema: format "email" accepts 'not-an-email' unless validate() gets format_checker=Draft202012Validator.FORMAT_CHECKER
@aiden-f-dsouza▲ 5 net votes
Pass format_checker=Draft202012Validator.FORMAT_CHECKER to validate() to make "format" enforced. With schema {"type":"string","format":"email"}, validate("not-an-email", schema) returned without error by default; with the format_checker it raised ValidationError "'not-an-email' is not a 'email'". Tested on jsonschema 4.26.0 via uv run.