diff --git a/bin/jsonschema_suite b/bin/jsonschema_suite index 4c15de3a..3d440613 100755 --- a/bin/jsonschema_suite +++ b/bin/jsonschema_suite @@ -38,6 +38,12 @@ REMOTES = { u"orNull": {u"anyOf": [{u"type": u"null"}, {u"$ref": u"#"}]}, }, }, + "name-defs.json": { + u"type": "string", + u"$defs": { + u"orNull": {u"anyOf": [{u"type": u"null"}, {u"$ref": u"#"}]}, + }, + }, "subSchemas.json": { u"integer": {u"type": u"integer"}, u"refToInteger": {u"$ref": u"#/integer"}, diff --git a/index.js b/index.js index c44aa028..b138226b 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,8 @@ const refs = { 'http://localhost:1234/integer.json': require('./remotes/integer.json'), 'http://localhost:1234/subSchemas.json': require('./remotes/subSchemas.json'), 'http://localhost:1234/folder/folderInteger.json': require('./remotes/folder/folderInteger.json'), - 'http://localhost:1234/name.json': require('./remotes/name.json') + 'http://localhost:1234/name.json': require('./remotes/name.json'), + 'http://localhost:1234/name-defs.json': require('./remotes/name-defs.json') }; const SKIP = { diff --git a/remotes/name-defs.json b/remotes/name-defs.json new file mode 100644 index 00000000..1a4fe4ac --- /dev/null +++ b/remotes/name-defs.json @@ -0,0 +1,11 @@ +{ + "$defs": { + "orNull": { + "anyOf": [ + {"type": "null"}, + {"$ref": "#"} + ] + } + }, + "type": "string" +} diff --git a/tests/draft2019-06/defs.json b/tests/draft2019-06/defs.json index 33fb52e7..e3c298d3 100644 --- a/tests/draft2019-06/defs.json +++ b/tests/draft2019-06/defs.json @@ -1,7 +1,7 @@ [ { "description": "valid definition", - "schema": {"$ref": "http://json-schema.org/draft-07/schema#"}, + "schema": {"$ref": "http://json-schema.org/draft/2019-06/schema#"}, "tests": [ { "description": "valid definition schema", @@ -12,7 +12,7 @@ }, { "description": "invalid definition", - "schema": {"$ref": "http://json-schema.org/draft-07/schema#"}, + "schema": {"$ref": "http://json-schema.org/draft/2019-06/schema#"}, "tests": [ { "description": "invalid definition schema", diff --git a/tests/draft2019-06/ref.json b/tests/draft2019-06/ref.json index e84ec10b..ab2ad95e 100644 --- a/tests/draft2019-06/ref.json +++ b/tests/draft2019-06/ref.json @@ -175,7 +175,7 @@ }, { "description": "remote ref, containing refs itself", - "schema": {"$ref": "http://json-schema.org/draft-07/schema#"}, + "schema": {"$ref": "http://json-schema.org/draft/2019-06/schema#"}, "tests": [ { "description": "remote ref valid", diff --git a/tests/draft2019-06/refRemote.json b/tests/draft2019-06/refRemote.json index 0e959f1e..9cadc926 100644 --- a/tests/draft2019-06/refRemote.json +++ b/tests/draft2019-06/refRemote.json @@ -135,7 +135,7 @@ "$id": "http://localhost:1234/object", "type": "object", "properties": { - "name": {"$ref": "name.json#/$defs/orNull"} + "name": {"$ref": "name-defs.json#/$defs/orNull"} } }, "tests": [