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 ff663f0 commit 467e171Copy full SHA for 467e171
jsonschema/exceptions.py
@@ -155,12 +155,18 @@ def _contents(self):
155
)
156
return dict((attr, getattr(self, attr)) for attr in attrs)
157
158
- def _matches_type(self):
+ def _matches_type(self) -> bool:
159
+ if isinstance(self.schema, _utils.Unset):
160
+ return False
161
+
162
try:
163
expected = self.schema["type"]
164
except (KeyError, TypeError):
165
return False
166
167
+ if isinstance(self._type_checker, _utils.Unset):
168
169
170
if isinstance(expected, str):
171
return self._type_checker.is_type(self.instance, expected)
172
0 commit comments