File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
tools/schemacode/src/bidsschematools Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 10
10
11
11
TYPE_CHECKING = False
12
12
if TYPE_CHECKING :
13
- from typing import Any
13
+ from typing import Any , NotRequired , TypedDict
14
14
15
+ from jsonschema import FormatChecker
15
16
from jsonschema .protocols import Validator as JsonschemaValidator
16
17
18
+ class ValidatorKwargs (TypedDict ):
19
+ """Type for the keyword arguments used to create a JSON schema validator."""
20
+
21
+ format_checker : NotRequired [FormatChecker ]
22
+
17
23
18
24
def get_bundled_schema_path ():
19
25
"""Get the path to the schema directory.
@@ -140,5 +146,6 @@ def jsonschema_validator(
140
146
# Ensure the schema is valid
141
147
validator_cls .check_schema (schema )
142
148
149
+ validator_kwargs : ValidatorKwargs
143
150
validator_kwargs = {"format_checker" : validator_cls .FORMAT_CHECKER } if check_format else {}
144
151
return validator_cls (schema , ** validator_kwargs )
You can’t perform that action at this time.
0 commit comments