Skip to content

Commit e0e768b

Browse files
committed
fix: ty check errors
1 parent 0041607 commit e0e768b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/JsonSchemaValidator/JsonSchemaValidator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ def load_new_schema(self, schema: str | Path | dict[str, Any]) -> None:
120120
| # Now validate payloads with the loaded schema
121121
122122
"""
123-
try:
123+
if isinstance(schema, dict):
124124
self._set_schema_validator(schema)
125-
except jsonschema.exceptions.SchemaError:
125+
else:
126126
data = self._read_json(schema)
127127
self._set_schema_validator(data)
128128
self.schema_loaded = True
@@ -473,7 +473,7 @@ def _read_json(self, file: str | Path) -> dict[str, Any]:
473473

474474

475475
@not_keyword
476-
def _set_errors(self, errors: list[any], source: str | None) -> None:
476+
def _set_errors(self, errors: list[Any], source: Optional[str | Path]) -> None:
477477
"""
478478
Store validation errors in the internal ``error_list`` buffer.
479479

0 commit comments

Comments
 (0)