Add FORMAT_CHECKER attribute for Validator#905
Add FORMAT_CHECKER attribute for Validator#905Julian merged 3 commits intopython-jsonschema:mainfrom TiborVoelcker:automatic_format_checker
Conversation
Codecov Report
@@ Coverage Diff @@
## main #905 +/- ##
==========================================
- Coverage 97.05% 97.02% -0.03%
==========================================
Files 20 20
Lines 3290 3295 +5
Branches 457 458 +1
==========================================
+ Hits 3193 3197 +4
Misses 77 77
- Partials 20 21 +1
Continue to review full report at Codecov.
|
|
Hey @Julian. Just so you know: altough I have been coding with Python for a couple of years, this is my first PR to a public repo, so I do not know what I am doing^^ I only did a few minor changes, but it did seem to work with the syntax you provided in #861. |
|
Wonderful, I'm sure it's great! Will have a look, do ping me if I don't do so and give you feedback in the next few days or so as I've got a lot of different things all stealing attention but yeah really appreciated! |
|
@TiborVoelcker Sorry for the delay in merging. This was perfect, well done. |
Format support / enablement will change with vocabulary support, but in the interim, now that #905 is merged, these objects are better accessed by retrieving them directly from the corresponding validator. In other words: don't do: from jsonschema import draft202012_format_checker just do from jsonschema import Draft202012Validator do_whatever_with(Draft202012Validator.FORMAT_CHECKER)
Implement an FORMAT_CHECKER attribute for the Validator class. This allows to use the
format_checkerof an automatically detected validator like so: