From dc001c2f3d19510839538c18882c7129c668505f Mon Sep 17 00:00:00 2001 From: Matt Allan Date: Tue, 23 Aug 2016 11:58:06 -0400 Subject: [PATCH] Add test for properties named $ref --- tests/draft4/ref.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/draft4/ref.json b/tests/draft4/ref.json index 7e805522..fe5aa901 100644 --- a/tests/draft4/ref.json +++ b/tests/draft4/ref.json @@ -155,5 +155,25 @@ "valid": false } ] + }, + { + "description": "property named $ref that is not a reference", + "schema": { + "properties": { + "$ref": {"type": "string"} + } + }, + "tests": [ + { + "description": "property named $ref valid", + "data": {"$ref": "a"}, + "valid": true + }, + { + "description": "property named $ref invalid", + "data": {"$ref": 2}, + "valid": false + } + ] } ]