python-jsonschema / jsonschema

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

@FormatChecker.checks decorator not a classmethod #1242

Closed ykursav closed 6 months ago

ykursav commented 6 months ago

Hello,

I am using jsonschema 4.21.1. When I tried to replace @FormatChecker.cls_checks with @FormatChecker.checks getting below error as it is not @classmethod:

TypeError: FormatChecker.checks() missing 1 required positional argument: 'self'

Julian commented 6 months ago

Hi there, it's indeed not a classmethod, it's a thing you need to call on a specific instance of format checker (possibly one for the draft you intend to extend).