Skip to content

Commit 0a24677

Browse files
committed
test: add comprehensive regression tests for historical closed issues
Add 52 test cases covering 44 closed GitHub issues across 10 categories: - Circular reference handling (9 tests) - Root-level $ref resolution (8 tests) - Bundle operations (4 tests) - Dereference operations (4 tests) - JSON Pointer handling (5 tests) - External references (2 tests) - Error handling (2 tests) - And 6 more categories Tests validate the current behavior of fixed issues and document expected behavior for issues that remain open. Includes 12 fixture files for testing external file resolution and complex schemas. All tests pass. Full test suite: 350 tests passing, 6 skipped.
1 parent 0fd077b commit 0a24677

File tree

13 files changed

+1415
-0
lines changed

13 files changed

+1415
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"definitions": {
4+
"bardef": { "type": "string" }
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"some_value": { "$ref": "defs.json#/definitions/astring" }
5+
}
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Person:
2+
type: object
3+
properties:
4+
name:
5+
type: string
6+
data:
7+
type: string
8+
default: "base64data"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "string",
3+
"enum": ["red", "green", "blue"]
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
components:
2+
schemas:
3+
ErrorResponse:
4+
type: object
5+
properties:
6+
message:
7+
type: string
8+
code:
9+
type: integer
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"definitions": {
3+
"astring": {
4+
"$ref": "defs2.json#/definitions/bstring"
5+
}
6+
}
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"definitions": {
3+
"bstring": {
4+
"type": "string",
5+
"minLength": 1,
6+
"maxLength": 100
7+
}
8+
}
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"definitions": {
4+
"foodef": { "$ref": "bar.json#/definitions/bardef" }
5+
},
6+
"type": "object",
7+
"properties": {
8+
"prop": {
9+
"$ref": "#/definitions/foodef"
10+
}
11+
}
12+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$id": "LinkedList.schema.json",
3+
"definitions": {
4+
"linkedList": {
5+
"type": "object",
6+
"properties": {
7+
"head": {
8+
"description": "The head of the list",
9+
"$ref": "node-schema.json#/definitions/node"
10+
}
11+
}
12+
}
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$id": "Node.schema.json",
3+
"definitions": {
4+
"node": {
5+
"type": "object",
6+
"properties": {
7+
"data": {
8+
"description": "Some data",
9+
"type": "integer"
10+
},
11+
"next": {
12+
"$ref": "#/definitions/node"
13+
}
14+
}
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)