We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_Error._matches_type
1 parent e2c3a06 commit efa28c6Copy full SHA for efa28c6
jsonschema/exceptions.py
@@ -154,12 +154,16 @@ def _contents(self):
154
)
155
return dict((attr, getattr(self, attr)) for attr in attrs)
156
157
- def _matches_type(self):
+ def _matches_type(self) -> bool:
158
try:
159
- expected = self.schema["type"]
+ # We ignore this as we want to simply crash if this happens
160
+ expected = self.schema["type"] # type: ignore[index]
161
except (KeyError, TypeError):
162
return False
163
164
+ if isinstance(self._type_checker, _utils.Unset):
165
+ return False
166
+
167
if isinstance(expected, str):
168
return self._type_checker.is_type(self.instance, expected)
169
0 commit comments