python-jsonschema / jsonschema

An implementation of the JSON Schema specification for Python
https://python-jsonschema.readthedocs.io
MIT License
4.52k stars 574 forks source link

Support hiding annotation keywords when reporting errors #1271

Open Julian opened 1 month ago

Julian commented 1 month ago

Sometimes a schema contains annotation-only keywords (particularly e.g. description or $comment) which effectively serve no purpose when reporting validation errors and essentially make the output longer / harder to read through.

While it would be nice if we had some even more fancy way of indicating what parts of the schema are relevant (e.g. via syntax highlighting and/or direct "arrow" pointing), a nice "cheaper" option would be to be able to render schemas without their annotation keywords (configurably).