ajv/spec/tests/issues/70_1_recursive_hash_ref_in_...

58 lines
2.2 KiB
JSON

[
{
"description": "hash ref inside hash ref in remote ref (#70, was passing)",
"schema": {
"$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0"
},
"tests": [
{ "data": 1, "valid": true, "description": "positive integer is valid" },
{ "data": 0, "valid": true, "description": "zero is valid" },
{ "data": -1, "valid": false, "description": "negative integer is invalid" }
]
},
{
"description": "hash ref inside hash ref in remote ref with id (#70, was passing)",
"schema": {
"$id": "http://example.com/my_schema_2.json",
"$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0"
},
"tests": [
{ "data": 1, "valid": true, "description": "positive integer is valid" },
{ "data": 0, "valid": true, "description": "zero is valid" },
{ "data": -1, "valid": false, "description": "negative integer is invalid" }
]
},
{
"description": "local hash ref with remote hash ref without inner hash ref (#70, was passing)",
"schema": {
"definitions": {
"a": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0" }
},
"properties": {
"b": { "$ref": "#/definitions/a" }
}
},
"tests": [
{ "data": { "b": 1 }, "valid": true, "description": "positive integer is valid" },
{ "data": { "b": 0 }, "valid": true, "description": "zero is valid" },
{ "data": { "b": -1 }, "valid": false, "description": "negative integer is invalid" }
]
},
{
"description": "local hash ref with remote hash ref that has inner hash ref (#70)",
"schema": {
"definitions": {
"a": { "$ref": "http://json-schema.org/draft-07/schema#/definitions/nonNegativeIntegerDefault0" }
},
"properties": {
"b": { "$ref": "#/definitions/a" }
}
},
"tests": [
{ "data": { "b": 1 }, "valid": true, "description": "positive integer is valid" },
{ "data": { "b": 0 }, "valid": true, "description": "zero is valid" },
{ "data": { "b": -1 }, "valid": false, "description": "negative integer is invalid" }
]
}
]