json-schema-validator/test/JSON-Schema-Test-Suite/tests/draft7/optional/format/json-pointer.json
Patrick Boettcher 7beb40bc61 Complete rewrite of the validator - aiming a 2.0-release
Schema a now "parsed" into C++-validator-objects in a first
step and then validation takes place with these objects.

Errors are now handled via a user-provided error-handler
allowing the user to collect all errors at once or bail out
when a certain threshold is reached. Fixes #36 and #8.

One (sub-)schema can now be referenced with different URIs. Fixes #9

JSON schema draft 7 is now supported. Fixes #35
2018-12-27 16:59:19 +01:00

169 lines
5.6 KiB
JSON

[
{
"description": "validation of JSON-pointers (JSON String Representation)",
"schema": {"format": "json-pointer"},
"tests": [
{
"description": "a valid JSON-pointer",
"data": "/foo/bar~0/baz~1/%a",
"valid": true
},
{
"description": "not a valid JSON-pointer (~ not escaped)",
"data": "/foo/bar~",
"valid": false
},
{
"description": "valid JSON-pointer with empty segment",
"data": "/foo//bar",
"valid": true
},
{
"description": "valid JSON-pointer with the last empty segment",
"data": "/foo/bar/",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #1",
"data": "",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #2",
"data": "/foo",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #3",
"data": "/foo/0",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #4",
"data": "/",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #5",
"data": "/a~1b",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #6",
"data": "/c%d",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #7",
"data": "/e^f",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #8",
"data": "/g|h",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #9",
"data": "/i\\j",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #10",
"data": "/k\"l",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #11",
"data": "/ ",
"valid": true
},
{
"description": "valid JSON-pointer as stated in RFC 6901 #12",
"data": "/m~0n",
"valid": true
},
{
"description": "valid JSON-pointer used adding to the last array position",
"data": "/foo/-",
"valid": true
},
{
"description": "valid JSON-pointer (- used as object member name)",
"data": "/foo/-/bar",
"valid": true
},
{
"description": "valid JSON-pointer (multiple escaped characters)",
"data": "/~1~0~0~1~1",
"valid": true
},
{
"description": "valid JSON-pointer (escaped with fraction part) #1",
"data": "/~1.1",
"valid": true
},
{
"description": "valid JSON-pointer (escaped with fraction part) #2",
"data": "/~0.1",
"valid": true
},
{
"description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
"data": "#",
"valid": false
},
{
"description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
"data": "#/",
"valid": false
},
{
"description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
"data": "#a",
"valid": false
},
{
"description": "not a valid JSON-pointer (some escaped, but not all) #1",
"data": "/~0~",
"valid": false
},
{
"description": "not a valid JSON-pointer (some escaped, but not all) #2",
"data": "/~0/~",
"valid": false
},
{
"description": "not a valid JSON-pointer (wrong escape character) #1",
"data": "/~2",
"valid": false
},
{
"description": "not a valid JSON-pointer (wrong escape character) #2",
"data": "/~-1",
"valid": false
},
{
"description": "not a valid JSON-pointer (multiple characters not escaped)",
"data": "/~~",
"valid": false
},
{
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
"data": "a",
"valid": false
},
{
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
"data": "0",
"valid": false
},
{
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
"data": "a/a",
"valid": false
}
]
}
]