mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-12-05 14:36:31 +01:00
Add comprehensive integration tests using the official JSON-Schema-Test-Suite draft2020-12 examples to ensure the CLI handles all valid JSON Schema constructs without crashing. Changes: - Add 80 fixture files from JSON-Schema-Test-Suite draft2020-12 - Add parallelized integration test that runs CLI against all 448 schemas - Normalize non-standard $ref patterns (root refs, JSON pointers, external URIs) - Decode URL-encoded and JSON pointer escaped characters in $ref paths - Embed type usages directly in $defs to avoid Tera lookup issues with special characters in definition names - Handle missing $defs gracefully in template rendering The test suite runs in ~5 seconds using Rayon for parallel execution.
102 lines
3.1 KiB
JSON
102 lines
3.1 KiB
JSON
[
|
|
{
|
|
"description": "validation of Relative JSON Pointers (RJP)",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"format": "relative-json-pointer"
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "all string formats ignore integers",
|
|
"data": 12,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "all string formats ignore floats",
|
|
"data": 13.7,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "all string formats ignore objects",
|
|
"data": {},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "all string formats ignore arrays",
|
|
"data": [],
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "all string formats ignore booleans",
|
|
"data": false,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "all string formats ignore nulls",
|
|
"data": null,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "a valid upwards RJP",
|
|
"data": "1",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "a valid downwards RJP",
|
|
"data": "0/foo/bar",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "a valid up and then down RJP, with array index",
|
|
"data": "2/0/baz/1/zip",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "a valid RJP taking the member or index name",
|
|
"data": "0#",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "an invalid RJP that is a valid JSON Pointer",
|
|
"data": "/foo/bar",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "negative prefix",
|
|
"data": "-1/foo/bar",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "explicit positive prefix",
|
|
"data": "+1/foo/bar",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "## is not a valid json-pointer",
|
|
"data": "0##",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "zero cannot be followed by other digits, plus json-pointer",
|
|
"data": "01/a",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "zero cannot be followed by other digits, plus octothorpe",
|
|
"data": "01#",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "empty string",
|
|
"data": "",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "multi-digit integer prefix",
|
|
"data": "120/foo/bar",
|
|
"valid": true
|
|
}
|
|
]
|
|
}
|
|
]
|