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 1010
1111TYPE_CHECKING = False
1212if TYPE_CHECKING :
13- from typing import Any
13+ from typing import Any , NotRequired , TypedDict
1414
15+ from jsonschema import FormatChecker
1516 from jsonschema .protocols import Validator as JsonschemaValidator
1617
18+ class ValidatorKwargs (TypedDict ):
19+ """Type for the keyword arguments used to create a JSON schema validator."""
20+
21+ format_checker : NotRequired [FormatChecker ]
22+
1723
1824def get_bundled_schema_path ():
1925 """Get the path to the schema directory.
@@ -140,5 +146,6 @@ def jsonschema_validator(
140146 # Ensure the schema is valid
141147 validator_cls .check_schema (schema )
142148
149+ validator_kwargs : ValidatorKwargs
143150 validator_kwargs = {"format_checker" : validator_cls .FORMAT_CHECKER } if check_format else {}
144151 return validator_cls (schema , ** validator_kwargs )
You can’t perform that action at this time.
0 commit comments