diff --git a/openapi_spec_validator/decorators.py b/openapi_spec_validator/decorators.py index 27eba96..94529dd 100644 --- a/openapi_spec_validator/decorators.py +++ b/openapi_spec_validator/decorators.py @@ -18,7 +18,8 @@ def __init__(self, instance_resolver): def __call__(self, func): def wrapped(validator, schema_element, instance, schema): - if not isinstance(instance, dict) or '$ref' not in instance: + if (not isinstance(instance, dict) or '$ref' not in instance + or not instance['$ref'].__hash__): for res in func(validator, schema_element, instance, schema): yield res return diff --git a/tests/integration/data/v3.0/petstore.yaml b/tests/integration/data/v3.0/petstore.yaml index 51c6273..a2ae6b2 100644 --- a/tests/integration/data/v3.0/petstore.yaml +++ b/tests/integration/data/v3.0/petstore.yaml @@ -93,6 +93,8 @@ components: type: string tag: type: string + $ref: + type: string Pets: type: array items: