Skip to content
Closed

Defs #267

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/jsonschema_suite
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
11 changes: 11 additions & 0 deletions remotes/name-defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$defs": {
"orNull": {
"anyOf": [
{"type": "null"},
{"$ref": "#"}
]
}
},
"type": "string"
}
4 changes: 2 additions & 2 deletions tests/draft2019-06/defs.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/draft2019-06/ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/draft2019-06/refRemote.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down