jspg progress
This commit is contained in:
208
tests/fixtures/old/ref.json
vendored
Executable file
208
tests/fixtures/old/ref.json
vendored
Executable file
@ -0,0 +1,208 @@
|
||||
[
|
||||
{
|
||||
"description": "root pointer ref",
|
||||
"schema": {
|
||||
"properties": {
|
||||
"foo": {
|
||||
"$ref": "#"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "match self",
|
||||
"data": {
|
||||
"foo": false
|
||||
},
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "recursive match",
|
||||
"data": {
|
||||
"foo": {
|
||||
"foo": false
|
||||
}
|
||||
},
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "mismatch",
|
||||
"data": {
|
||||
"bar": false
|
||||
},
|
||||
"valid": false
|
||||
},
|
||||
{
|
||||
"description": "recursive mismatch",
|
||||
"data": {
|
||||
"foo": {
|
||||
"bar": false
|
||||
}
|
||||
},
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "relative pointer ref to object",
|
||||
"schema": {
|
||||
"$id": "http://example.com/root.json",
|
||||
"definitions": {
|
||||
"foo": {
|
||||
"type": "integer"
|
||||
},
|
||||
"bar": {
|
||||
"$ref": "#/definitions/foo"
|
||||
}
|
||||
},
|
||||
"$ref": "#/definitions/bar"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "match integer",
|
||||
"data": 1,
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "mismatch string",
|
||||
"data": "a",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "escaped pointer ref",
|
||||
"schema": {
|
||||
"$id": "http://example.com/tilda.json",
|
||||
"definitions": {
|
||||
"tilde~field": {
|
||||
"type": "integer"
|
||||
},
|
||||
"slash/field": {
|
||||
"type": "integer"
|
||||
},
|
||||
"percent%field": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"tilde": {
|
||||
"$ref": "#/definitions/tilde~0field"
|
||||
},
|
||||
"slash": {
|
||||
"$ref": "#/definitions/slash~1field"
|
||||
},
|
||||
"percent": {
|
||||
"$ref": "#/definitions/percent%25field"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "slash valid",
|
||||
"data": {
|
||||
"slash": 1
|
||||
},
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "tilde valid",
|
||||
"data": {
|
||||
"tilde": 1
|
||||
},
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "percent valid",
|
||||
"data": {
|
||||
"percent": 1
|
||||
},
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "slash invalid",
|
||||
"data": {
|
||||
"slash": "a"
|
||||
},
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "nested refs",
|
||||
"schema": {
|
||||
"$id": "http://example.com/nested.json",
|
||||
"definitions": {
|
||||
"a": {
|
||||
"type": "integer"
|
||||
},
|
||||
"b": {
|
||||
"$ref": "#/definitions/a"
|
||||
},
|
||||
"c": {
|
||||
"$ref": "#/definitions/b"
|
||||
}
|
||||
},
|
||||
"$ref": "#/definitions/c"
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "nested match",
|
||||
"data": 5,
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "nested mismatch",
|
||||
"data": "a",
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ref to array item",
|
||||
"schema": {
|
||||
"prefixItems": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"definitions": {
|
||||
"first": {
|
||||
"$ref": "#/prefixItems/0"
|
||||
},
|
||||
"second": {
|
||||
"$ref": "#/prefixItems/1"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"a": {
|
||||
"$ref": "#/definitions/first"
|
||||
},
|
||||
"b": {
|
||||
"$ref": "#/definitions/second"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "valid array items",
|
||||
"data": {
|
||||
"a": 1,
|
||||
"b": "foo"
|
||||
},
|
||||
"valid": true
|
||||
},
|
||||
{
|
||||
"description": "invalid array items",
|
||||
"data": {
|
||||
"a": "foo",
|
||||
"b": 1
|
||||
},
|
||||
"valid": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user