diff --git a/tests/draft2019-09/ref.json b/tests/draft2019-09/ref.json index a756eb0d..97f70544 100644 --- a/tests/draft2019-09/ref.json +++ b/tests/draft2019-09/ref.json @@ -211,6 +211,31 @@ } ] }, + { + "description": "property named $ref, containing an actual $ref", + "schema": { + "properties": { + "$ref": {"$ref": "#/$defs/is-string"} + }, + "$defs": { + "is-string": { + "type": "string" + } + } + }, + "tests": [ + { + "description": "property named $ref valid", + "data": {"$ref": "a"}, + "valid": true + }, + { + "description": "property named $ref invalid", + "data": {"$ref": 2}, + "valid": false + } + ] + }, { "description": "$ref to boolean schema true", "schema": { diff --git a/tests/draft3/ref.json b/tests/draft3/ref.json index bd6b7778..74e963c4 100644 --- a/tests/draft3/ref.json +++ b/tests/draft3/ref.json @@ -173,6 +173,31 @@ } ] }, + { + "description": "property named $ref, containing an actual $ref", + "schema": { + "properties": { + "$ref": {"$ref": "#/definitions/is-string"} + }, + "definitions": { + "is-string": { + "type": "string" + } + } + }, + "tests": [ + { + "description": "property named $ref valid", + "data": {"$ref": "a"}, + "valid": true + }, + { + "description": "property named $ref invalid", + "data": {"$ref": 2}, + "valid": false + } + ] + }, { "description": "remote ref, containing refs itself", "schema": {"$ref": "http://json-schema.org/draft-03/schema#"}, diff --git a/tests/draft4/ref.json b/tests/draft4/ref.json index 895c880a..fc3e94be 100644 --- a/tests/draft4/ref.json +++ b/tests/draft4/ref.json @@ -209,6 +209,31 @@ } ] }, + { + "description": "property named $ref, containing an actual $ref", + "schema": { + "properties": { + "$ref": {"$ref": "#/definitions/is-string"} + }, + "definitions": { + "is-string": { + "type": "string" + } + } + }, + "tests": [ + { + "description": "property named $ref valid", + "data": {"$ref": "a"}, + "valid": true + }, + { + "description": "property named $ref invalid", + "data": {"$ref": 2}, + "valid": false + } + ] + }, { "description": "Recursive references between schemas", "schema": { diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json index 6c29f228..8eaba56f 100644 --- a/tests/draft6/ref.json +++ b/tests/draft6/ref.json @@ -209,6 +209,31 @@ } ] }, + { + "description": "property named $ref, containing an actual $ref", + "schema": { + "properties": { + "$ref": {"$ref": "#/definitions/is-string"} + }, + "definitions": { + "is-string": { + "type": "string" + } + } + }, + "tests": [ + { + "description": "property named $ref valid", + "data": {"$ref": "a"}, + "valid": true + }, + { + "description": "property named $ref invalid", + "data": {"$ref": 2}, + "valid": false + } + ] + }, { "description": "$ref to boolean schema true", "schema": { diff --git a/tests/draft7/ref.json b/tests/draft7/ref.json index 9f1d81a7..5a8602ec 100644 --- a/tests/draft7/ref.json +++ b/tests/draft7/ref.json @@ -209,6 +209,31 @@ } ] }, + { + "description": "property named $ref, containing an actual $ref", + "schema": { + "properties": { + "$ref": {"$ref": "#/definitions/is-string"} + }, + "definitions": { + "is-string": { + "type": "string" + } + } + }, + "tests": [ + { + "description": "property named $ref valid", + "data": {"$ref": "a"}, + "valid": true + }, + { + "description": "property named $ref invalid", + "data": {"$ref": 2}, + "valid": false + } + ] + }, { "description": "$ref to boolean schema true", "schema": {