Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 8e3a9cd

Browse files
authored
fix: handle referencing circular remote refs with JSON pointers (#141)
* fix: call stack exceeded * test: move fixtures * test: async describe in benchmark.test * test: rename * fix: rely on pointerStack + include an extra test
1 parent 86e67b2 commit 8e3a9cd

File tree

8 files changed

+573
-2
lines changed

8 files changed

+573
-2
lines changed

src/__tests__/benchmark.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const { ResolveRunner } = require('../runner');
1717
* 2. `yarn test tests/benchmark.spec.ts`
1818
*/
1919

20-
describe.skip('benchmark', async () => {
20+
describe.skip('benchmark', () => {
2121
test('huge circular resolve', async () => {
2222
const suite = new Benchmark.Suite();
2323
await new Promise(resolve => {
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
{
2+
"ApiResponse": {
3+
"properties": {
4+
"code": {
5+
"format": "int32",
6+
"type": "integer"
7+
},
8+
"message": {
9+
"type": "string"
10+
},
11+
"type": {
12+
"type": "string"
13+
}
14+
},
15+
"type": "object"
16+
},
17+
"Category": {
18+
"properties": {
19+
"id": {
20+
"format": "int64",
21+
"type": "integer"
22+
},
23+
"name": {
24+
"type": "string"
25+
}
26+
},
27+
"type": "object",
28+
"xml": {
29+
"name": "Category"
30+
}
31+
},
32+
"Order": {
33+
"properties": {
34+
"complete": {
35+
"type": "boolean"
36+
},
37+
"id": {
38+
"format": "int64",
39+
"type": "integer"
40+
},
41+
"petId": {
42+
"format": "int64",
43+
"type": "integer"
44+
},
45+
"quantity": {
46+
"properties": {
47+
"completed": {
48+
"type": [
49+
"boolean",
50+
"null"
51+
]
52+
},
53+
"name": {
54+
"$ref": "#/definitions/todo-full"
55+
}
56+
},
57+
"required": [
58+
"name",
59+
"completed"
60+
],
61+
"title": "Todo Partial",
62+
"type": "object"
63+
},
64+
"shipDate": {
65+
"format": "date-time",
66+
"type": "string"
67+
},
68+
"status": {
69+
"description": "Order Status",
70+
"enum": [
71+
"placed",
72+
"approved",
73+
"delivered"
74+
],
75+
"type": "string"
76+
}
77+
},
78+
"type": "object",
79+
"xml": {
80+
"name": "Order"
81+
}
82+
},
83+
"Pet": {
84+
"properties": {
85+
"category": {
86+
"$ref": "#/definitions/Category"
87+
},
88+
"id": {
89+
"format": "int64",
90+
"type": "integer"
91+
},
92+
"name": {
93+
"example": "doggie",
94+
"type": "string"
95+
},
96+
"photoUrls": {
97+
"items": {
98+
"type": "string",
99+
"xml": {
100+
"name": "photoUrl"
101+
}
102+
},
103+
"type": "array",
104+
"xml": {
105+
"wrapped": true
106+
}
107+
},
108+
"status": {
109+
"description": "pet status in the store",
110+
"enum": [
111+
"available",
112+
"pending",
113+
"sold"
114+
],
115+
"type": "string"
116+
},
117+
"tags": {
118+
"items": {
119+
"$ref": "#/definitions/Tag",
120+
"xml": {
121+
"name": "tag"
122+
}
123+
},
124+
"type": "array",
125+
"xml": {
126+
"wrapped": true
127+
}
128+
}
129+
},
130+
"required": [
131+
"name",
132+
"photoUrls"
133+
],
134+
"type": "object",
135+
"xml": {
136+
"name": "Pet"
137+
}
138+
},
139+
"Tag": {
140+
"properties": {
141+
"id": {
142+
"$ref": "#/definitions/Order"
143+
},
144+
"name": {
145+
"type": "string"
146+
}
147+
},
148+
"type": "object",
149+
"xml": {
150+
"name": "Tag"
151+
}
152+
},
153+
"User": {
154+
"properties": {
155+
"email": {
156+
"type": "string"
157+
},
158+
"firstName": {
159+
"type": "string"
160+
},
161+
"id": {
162+
"format": "int64",
163+
"type": "integer"
164+
},
165+
"lastName": {
166+
"type": "string"
167+
},
168+
"password": {
169+
"type": "string"
170+
},
171+
"phone": {
172+
"type": "string"
173+
},
174+
"userStatus": {
175+
"description": "User Status",
176+
"format": "int32",
177+
"type": "integer"
178+
},
179+
"username": {
180+
"type": "string"
181+
}
182+
},
183+
"type": "object",
184+
"xml": {
185+
"name": "User"
186+
}
187+
}
188+
}

0 commit comments

Comments
 (0)