Skip to content

Commit c72d85b

Browse files
committed
A $ref may be a property name and in such cases it's not hashable
This is not a "proper fix" as the proper fix should check if `$ref` is used as a name of the property, but this works for the purposes of #123 fixes #123
1 parent 2adca8a commit c72d85b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

openapi_spec_validator/decorators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def __init__(self, instance_resolver):
1818

1919
def __call__(self, func):
2020
def wrapped(validator, schema_element, instance, schema):
21-
if not isinstance(instance, dict) or '$ref' not in instance:
21+
if (not isinstance(instance, dict) or '$ref' not in instance
22+
or not instance['$ref'].__hash__):
2223
for res in func(validator, schema_element, instance, schema):
2324
yield res
2425
return

0 commit comments

Comments
 (0)