@scalar/openapi-parser 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +134 -0
  3. package/dist/configuration/index.d.ts +2 -2
  4. package/dist/configuration/index.js +2 -2
  5. package/dist/configuration/index.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +4 -0
  9. package/dist/index.js.map +2 -2
  10. package/dist/types/index.d.ts +1 -0
  11. package/dist/types/index.d.ts.map +1 -1
  12. package/dist/utils/bundle/bundle.d.ts +193 -0
  13. package/dist/utils/bundle/bundle.d.ts.map +1 -0
  14. package/dist/utils/bundle/bundle.js +197 -0
  15. package/dist/utils/bundle/bundle.js.map +7 -0
  16. package/dist/utils/bundle/create-limiter.d.ts +21 -0
  17. package/dist/utils/bundle/create-limiter.d.ts.map +1 -0
  18. package/dist/utils/bundle/create-limiter.js +31 -0
  19. package/dist/utils/bundle/create-limiter.js.map +7 -0
  20. package/dist/utils/bundle/index.d.ts +4 -0
  21. package/dist/utils/bundle/index.d.ts.map +1 -0
  22. package/dist/utils/bundle/index.js +9 -0
  23. package/dist/utils/bundle/index.js.map +7 -0
  24. package/dist/utils/bundle/plugins/fetch-urls.d.ts +38 -0
  25. package/dist/utils/bundle/plugins/fetch-urls.d.ts.map +1 -0
  26. package/dist/utils/bundle/plugins/fetch-urls.js +40 -0
  27. package/dist/utils/bundle/plugins/fetch-urls.js.map +7 -0
  28. package/dist/utils/bundle/plugins/read-files.d.ts +29 -0
  29. package/dist/utils/bundle/plugins/read-files.d.ts.map +1 -0
  30. package/dist/utils/bundle/plugins/read-files.js +30 -0
  31. package/dist/utils/bundle/plugins/read-files.js.map +7 -0
  32. package/dist/utils/details.d.ts +1 -2
  33. package/dist/utils/details.d.ts.map +1 -1
  34. package/dist/utils/details.js +12 -9
  35. package/dist/utils/details.js.map +2 -2
  36. package/dist/utils/normalize.d.ts +1 -1
  37. package/dist/utils/normalize.d.ts.map +1 -1
  38. package/dist/utils/normalize.js +16 -11
  39. package/dist/utils/normalize.js.map +2 -2
  40. package/dist/utils/resolve-references.d.ts.map +1 -1
  41. package/dist/utils/resolve-references.js +11 -0
  42. package/dist/utils/resolve-references.js.map +2 -2
  43. package/package.json +5 -5
  44. package/dist/lib/Validator/Validator.test.js +0 -8
  45. package/dist/lib/Validator/Validator.test.js.map +0 -7
  46. package/dist/plugins/fetch-urls/fetch-urls.test.js +0 -50
  47. package/dist/plugins/fetch-urls/fetch-urls.test.js.map +0 -7
  48. package/dist/plugins/read-files/read-files.test.js +0 -20
  49. package/dist/plugins/read-files/read-files.test.js.map +0 -7
  50. package/dist/utils/dereference.test.js +0 -300
  51. package/dist/utils/dereference.test.js.map +0 -7
  52. package/dist/utils/errors.test.js +0 -48
  53. package/dist/utils/errors.test.js.map +0 -7
  54. package/dist/utils/escape-json-pointer.test.js +0 -11
  55. package/dist/utils/escape-json-pointer.test.js.map +0 -7
  56. package/dist/utils/get-entrypoint.test.js +0 -18
  57. package/dist/utils/get-entrypoint.test.js.map +0 -7
  58. package/dist/utils/get-segments-from-path.test.js +0 -13
  59. package/dist/utils/get-segments-from-path.test.js.map +0 -7
  60. package/dist/utils/is-filesystem.test.js +0 -15
  61. package/dist/utils/is-filesystem.test.js.map +0 -7
  62. package/dist/utils/is-object.test.js +0 -23
  63. package/dist/utils/is-object.test.js.map +0 -7
  64. package/dist/utils/load/load.test.js +0 -361
  65. package/dist/utils/load/load.test.js.map +0 -7
  66. package/dist/utils/normalize.test.js +0 -88
  67. package/dist/utils/normalize.test.js.map +0 -7
  68. package/dist/utils/resolve-references.test.js +0 -567
  69. package/dist/utils/resolve-references.test.js.map +0 -7
  70. package/dist/utils/transform/sanitize.test.js +0 -148
  71. package/dist/utils/transform/sanitize.test.js.map +0 -7
  72. package/dist/utils/transform-errors.test.js +0 -17
  73. package/dist/utils/transform-errors.test.js.map +0 -7
  74. package/dist/utils/traverse.test.js +0 -68
  75. package/dist/utils/traverse.test.js.map +0 -7
  76. package/dist/utils/unescape-json-pointer.test.js +0 -19
  77. package/dist/utils/unescape-json-pointer.test.js.map +0 -7
  78. package/dist/utils/upgrade-from-three-to-three-one.test.js +0 -462
  79. package/dist/utils/upgrade-from-three-to-three-one.test.js.map +0 -7
  80. package/dist/utils/upgrade-from-two-to-three.test.js +0 -589
  81. package/dist/utils/upgrade-from-two-to-three.test.js.map +0 -7
  82. package/dist/utils/upgrade.test.js +0 -57
  83. package/dist/utils/upgrade.test.js.map +0 -7
  84. package/dist/utils/validate.test.js +0 -64
  85. package/dist/utils/validate.test.js.map +0 -7
@@ -1,567 +0,0 @@
1
- import path from "node:path";
2
- import SwaggerParser from "@apidevtools/swagger-parser";
3
- import { describe, expect, it } from "vitest";
4
- import { readFiles } from "../plugins/read-files/read-files.js";
5
- import { load } from "./load/load.js";
6
- import { resolveReferences } from "./resolve-references.js";
7
- const EXAMPLE_FILE = path.join(new URL(import.meta.url).pathname, "../../../tests/filesystem/api/openapi.yaml");
8
- describe("resolveReferences", () => {
9
- it("resolves a single reference", async () => {
10
- const specification = {
11
- openapi: "3.1.0",
12
- info: {},
13
- paths: {
14
- "/foobar": {
15
- post: {
16
- requestBody: {
17
- $ref: "#/components/requestBodies/Foobar"
18
- }
19
- }
20
- }
21
- },
22
- components: {
23
- requestBodies: {
24
- Foobar: {
25
- content: {}
26
- }
27
- }
28
- }
29
- };
30
- const { schema } = resolveReferences(specification);
31
- expect(schema.paths["/foobar"].post.requestBody.content).not.toBe(void 0);
32
- });
33
- it("returns an error when a reference can\u2019t be found", async () => {
34
- const specification = {
35
- openapi: "3.1.0",
36
- info: {},
37
- paths: {
38
- "/foobar": {
39
- post: {
40
- requestBody: {
41
- $ref: "#/components/WrongReference"
42
- }
43
- }
44
- }
45
- }
46
- };
47
- const { valid, errors } = resolveReferences(specification);
48
- expect(errors).not.toBe(void 0);
49
- expect(errors).not.toStrictEqual([]);
50
- expect(errors[0].message).toBe("Can\u2019t resolve reference: #/components/WrongReference");
51
- expect(errors.length).toBe(1);
52
- expect(valid).toBe(false);
53
- });
54
- it("returns an error when an external reference can\u2019t be found", async () => {
55
- const specification = {
56
- openapi: "3.1.0",
57
- info: {},
58
- paths: {
59
- "/foobar": {
60
- post: {
61
- requestBody: {
62
- $ref: "foo/bar/foobar.yaml#/components/WrongReference"
63
- }
64
- }
65
- }
66
- }
67
- };
68
- const { valid, errors } = resolveReferences(specification);
69
- expect(errors).not.toBe(void 0);
70
- expect(errors).not.toStrictEqual([]);
71
- expect(errors[0].message).toBe("Can\u2019t resolve external reference: foo/bar/foobar.yaml");
72
- expect(errors.length).toBe(1);
73
- expect(valid).toBe(false);
74
- });
75
- it("matches output of @apidevtools/swagger-parser", async () => {
76
- const specification = {
77
- openapi: "3.1.0",
78
- info: {},
79
- paths: {
80
- "/foobar": {
81
- post: {
82
- requestBody: {
83
- $ref: "#/components/requestBodies/Foobar"
84
- }
85
- }
86
- }
87
- },
88
- components: {
89
- requestBodies: {
90
- Foobar: {
91
- content: {}
92
- }
93
- }
94
- }
95
- };
96
- const oldSchema = await new Promise((resolve, reject) => {
97
- SwaggerParser.dereference(structuredClone(specification), (error, result) => {
98
- if (error) {
99
- reject(error);
100
- }
101
- if (result === void 0) {
102
- reject("Couldn\u2019t parse the Swagger file.");
103
- return;
104
- }
105
- resolve(result);
106
- });
107
- }).catch((error) => {
108
- console.error("[@apidevtools/swagger-parser]", error);
109
- });
110
- const newParser = resolveReferences(specification);
111
- expect(newParser.schema.paths["/foobar"].post.requestBody).toMatchObject(
112
- oldSchema.paths["/foobar"].post.requestBody
113
- );
114
- });
115
- it("resolves references inside references", async () => {
116
- const specification = {
117
- openapi: "3.1.0",
118
- info: {},
119
- paths: {
120
- "/foobar": {
121
- post: {
122
- requestBody: {
123
- $ref: "#/components/requestBodies/Foobar"
124
- }
125
- }
126
- }
127
- },
128
- components: {
129
- requestBodies: {
130
- CursorRequest: {
131
- content: {}
132
- },
133
- Foobar: {
134
- // This is a reference to another reference
135
- $ref: "#/components/requestBodies/CursorRequest"
136
- }
137
- }
138
- }
139
- };
140
- const oldSchema = await new Promise((resolve, reject) => {
141
- SwaggerParser.dereference(structuredClone(specification), (error, result) => {
142
- if (error) {
143
- reject(error);
144
- }
145
- if (result === void 0) {
146
- reject("Couldn\u2019t parse the Swagger file.");
147
- return;
148
- }
149
- resolve(result);
150
- });
151
- }).catch((error) => {
152
- console.error("[@apidevtools/swagger-parser]", error);
153
- });
154
- const newParser = resolveReferences(specification);
155
- expect(newParser.schema.paths["/foobar"].post.requestBody).toMatchObject(
156
- oldSchema.paths["/foobar"].post.requestBody
157
- );
158
- });
159
- it("resolves references in arrays", async () => {
160
- const specification = {
161
- openapi: "3.1.0",
162
- info: {},
163
- paths: {
164
- "/foobar": {
165
- post: {
166
- requestBody: {
167
- $ref: "#/components/requestBodies/Foobar"
168
- }
169
- }
170
- }
171
- },
172
- components: {
173
- schemas: {
174
- Barfoo: {
175
- type: "string",
176
- example: "barfoo"
177
- }
178
- },
179
- requestBodies: {
180
- Foobar: {
181
- content: {
182
- "application/json": {
183
- schema: {
184
- oneOf: [
185
- {
186
- $ref: "#/components/schemas/Barfoo"
187
- }
188
- ]
189
- }
190
- }
191
- }
192
- }
193
- }
194
- }
195
- };
196
- const { schema } = resolveReferences(specification);
197
- expect(schema.paths["/foobar"].post.requestBody.content["application/json"].schema.oneOf[0]).toMatchObject({
198
- type: "string",
199
- example: "barfoo"
200
- });
201
- });
202
- it("merges original properties and referenced content", async () => {
203
- const specification = {
204
- openapi: "3.1.0",
205
- info: {},
206
- paths: {
207
- "/foobar": {
208
- post: {
209
- requestBody: {
210
- $ref: "#/components/requestBodies/Foobar"
211
- }
212
- }
213
- }
214
- },
215
- components: {
216
- schemas: {
217
- Barfoo: {
218
- type: "string",
219
- example: "barfoo"
220
- }
221
- },
222
- requestBodies: {
223
- Foobar: {
224
- content: {
225
- "application/json": {
226
- schema: {
227
- oneOf: [
228
- {
229
- description: "This is a barfoo",
230
- $ref: "#/components/schemas/Barfoo"
231
- }
232
- ]
233
- }
234
- }
235
- }
236
- }
237
- }
238
- }
239
- };
240
- const { schema } = resolveReferences(specification);
241
- expect(schema.paths["/foobar"].post.requestBody.content["application/json"].schema.oneOf[0]).toMatchObject({
242
- type: "string",
243
- example: "barfoo",
244
- description: "This is a barfoo"
245
- });
246
- });
247
- it("references inside references still keep the reference to the original JS object", async () => {
248
- const specification = {
249
- swagger: "2.0",
250
- info: {
251
- title: "Branded Fares Upsell",
252
- version: "1.0.1"
253
- },
254
- paths: {
255
- "/foobar": {
256
- post: {
257
- responses: {
258
- "200": {
259
- $ref: "#/responses/returnUpsell"
260
- }
261
- }
262
- }
263
- }
264
- },
265
- responses: {
266
- returnUpsell: {
267
- schema: {
268
- type: "object",
269
- properties: {
270
- dictionaries: {
271
- $ref: "#/definitions/LocationEntry"
272
- }
273
- }
274
- }
275
- }
276
- },
277
- definitions: {
278
- Dictionaries: {
279
- type: "object",
280
- properties: {
281
- locations: {
282
- $ref: "#/definitions/LocationEntry"
283
- }
284
- }
285
- },
286
- LocationEntry: {
287
- additionalProperties: {
288
- $ref: "#/definitions/LocationValue"
289
- }
290
- },
291
- LocationValue: {
292
- properties: {
293
- cityCode: {
294
- description: "City code associated to the airport",
295
- example: "PAR",
296
- type: "string"
297
- }
298
- }
299
- }
300
- }
301
- };
302
- const { schema } = resolveReferences(specification);
303
- expect(schema.swagger).toBe("2.0");
304
- expect(
305
- schema.paths["/foobar"].post.responses[200].schema.properties.dictionaries.additionalProperties
306
- ).toMatchObject({
307
- properties: {
308
- cityCode: {
309
- description: "City code associated to the airport",
310
- example: "PAR",
311
- type: "string"
312
- }
313
- }
314
- });
315
- });
316
- it("resolves a simple circular reference", async () => {
317
- const partialSpecification = {
318
- foo: {
319
- bar: {
320
- $ref: "#/foo"
321
- }
322
- }
323
- };
324
- const { schema } = resolveReferences(partialSpecification);
325
- expect(() => JSON.stringify(schema, null, 2)).toThrow();
326
- expect(schema.foo.bar.bar.bar.bar.bar.bar.bar.bar).toBeTypeOf("object");
327
- });
328
- it("resolves a more advanced circular reference", async () => {
329
- const partialSpecification = {
330
- type: "object",
331
- properties: {
332
- element: { $ref: "#/schemas/element" },
333
- foobar: { $ref: "#/schemas/foobar" }
334
- },
335
- schemas: {
336
- element: {
337
- type: "object",
338
- properties: {
339
- element: { $ref: "#/schemas/element" }
340
- }
341
- },
342
- foobar: {
343
- type: "object",
344
- properties: {
345
- foobar: { $ref: "#/schemas/foobar" }
346
- }
347
- }
348
- }
349
- };
350
- const { schema } = resolveReferences(partialSpecification);
351
- expect(() => JSON.stringify(schema, null, 2)).toThrow();
352
- expect(schema.schemas.element.properties.element.properties.element.properties.element).toBeTypeOf("object");
353
- });
354
- it("resolves an OpenAPI-like circular reference", async () => {
355
- const specification = {
356
- type: "object",
357
- properties: {
358
- element: { $ref: "#/schemas/element" }
359
- },
360
- schemas: {
361
- element: {
362
- type: "object",
363
- properties: {
364
- element: { $ref: "#/schemas/element" }
365
- }
366
- }
367
- }
368
- };
369
- const { schema } = resolveReferences(specification);
370
- expect(specification.properties.element.$ref).toBeTypeOf("string");
371
- expect(schema.properties.element.type).toBe("object");
372
- expect(schema.properties.element.properties.element.type).toBe("object");
373
- expect(schema.properties.element.properties.element.properties.element.type).toBe("object");
374
- expect(() => JSON.stringify(schema, null, 2)).toThrow();
375
- });
376
- it("composes two files", async () => {
377
- const filesystem = [
378
- {
379
- dir: "/Foobar",
380
- isEntrypoint: true,
381
- references: ["other/folder/foobar.json"],
382
- filename: "openapi.json",
383
- specification: {
384
- openapi: "3.1.0",
385
- info: {},
386
- paths: {
387
- "/foobar": {
388
- post: {
389
- requestBody: {
390
- $ref: "other/folder/foobar.json"
391
- }
392
- }
393
- }
394
- }
395
- }
396
- },
397
- {
398
- dir: "/Foobar/other/folder",
399
- isEntrypoint: false,
400
- references: [],
401
- filename: "other/folder/foobar.json",
402
- specification: {
403
- content: {
404
- "application/json": {
405
- schema: {
406
- type: "string",
407
- example: "foobar"
408
- }
409
- }
410
- }
411
- }
412
- }
413
- ];
414
- const { schema } = resolveReferences(filesystem);
415
- expect(schema.paths["/foobar"].post.requestBody.content["application/json"].schema.example).toBe("foobar");
416
- });
417
- it("resolves reference to a part of an external file", async () => {
418
- const filesystem = [
419
- {
420
- dir: "/Foobar",
421
- isEntrypoint: true,
422
- references: ["other/folder/foobar.json"],
423
- filename: "openapi.json",
424
- specification: {
425
- openapi: "3.1.0",
426
- info: {},
427
- paths: {
428
- "/foobar": {
429
- post: {
430
- requestBody: {
431
- $ref: "other/folder/foobar.json#/components/requestBodies/Foobar"
432
- }
433
- }
434
- }
435
- }
436
- }
437
- },
438
- {
439
- dir: "/Foobar/other/folder",
440
- isEntrypoint: false,
441
- references: [],
442
- filename: "other/folder/foobar.json",
443
- specification: {
444
- components: {
445
- requestBodies: {
446
- Foobar: {
447
- content: {
448
- "application/json": {
449
- schema: {
450
- type: "string",
451
- example: "foobar"
452
- }
453
- }
454
- }
455
- }
456
- }
457
- }
458
- }
459
- }
460
- ];
461
- const { schema } = resolveReferences(filesystem);
462
- expect(schema.paths["/foobar"].post.requestBody.content["application/json"].schema.example).toBe("foobar");
463
- });
464
- it("resolves references in external files", async () => {
465
- const filesystem = [
466
- {
467
- dir: "/Foobar",
468
- isEntrypoint: true,
469
- references: ["other/folder/foobar.json"],
470
- filename: "openapi.json",
471
- specification: {
472
- openapi: "3.1.0",
473
- info: {},
474
- paths: {
475
- "/foobar": {
476
- post: {
477
- requestBody: {
478
- $ref: "other/folder/foobar.json#/components/requestBodies/Foobar"
479
- }
480
- }
481
- }
482
- }
483
- }
484
- },
485
- {
486
- dir: "/Foobar/other/folder",
487
- isEntrypoint: false,
488
- references: ["barfoo.json"],
489
- filename: "other/folder/foobar.json",
490
- specification: {
491
- components: {
492
- requestBodies: {
493
- Foobar: {
494
- $ref: "barfoo.json"
495
- }
496
- }
497
- }
498
- }
499
- },
500
- {
501
- dir: "/Foobar/other/folder",
502
- isEntrypoint: false,
503
- references: [],
504
- filename: "barfoo.json",
505
- specification: {
506
- content: {
507
- "application/json": {
508
- schema: {
509
- type: "string",
510
- example: "foobar"
511
- }
512
- }
513
- }
514
- }
515
- }
516
- ];
517
- const { schema } = resolveReferences(filesystem);
518
- expect(schema.paths["/foobar"].post.requestBody.content["application/json"].schema.example).toBe("foobar");
519
- });
520
- it("resolves from filesystem", async () => {
521
- const { filesystem } = await load(EXAMPLE_FILE, {
522
- plugins: [readFiles()]
523
- });
524
- const { schema } = resolveReferences(filesystem);
525
- expect(schema.components.schemas.Upload.allOf[0].title).toBe("Coordinates");
526
- });
527
- it("resolves reference to self by filename", async () => {
528
- const filesystem = [
529
- {
530
- dir: "/Foobar",
531
- isEntrypoint: true,
532
- references: [],
533
- filename: "openapi.json",
534
- specification: {
535
- openapi: "3.1.0",
536
- info: {},
537
- paths: {
538
- "/foobar": {
539
- post: {
540
- requestBody: {
541
- $ref: "openapi.json#/components/requestBodies/Foobar"
542
- }
543
- }
544
- }
545
- },
546
- components: {
547
- requestBodies: {
548
- Foobar: {
549
- content: {
550
- "application/json": {
551
- schema: {
552
- type: "string",
553
- example: "foobar"
554
- }
555
- }
556
- }
557
- }
558
- }
559
- }
560
- }
561
- }
562
- ];
563
- const { schema } = resolveReferences(filesystem);
564
- expect(schema.paths["/foobar"].post.requestBody.content["application/json"].schema.example).toBe("foobar");
565
- });
566
- });
567
- //# sourceMappingURL=resolve-references.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils/resolve-references.test.ts"],
4
- "sourcesContent": ["import path from 'node:path'\n/**\n * This file has some simple tests to cover the basics of the resolveReferences function.\n * Doesn\u2019t cover all edge cases, doesn\u2019t have big files, but if this works you\u2019re almost there.\n */\nimport SwaggerParser from '@apidevtools/swagger-parser'\nimport { describe, expect, it } from 'vitest'\n\nimport { readFiles } from '@/plugins/read-files/read-files'\nimport type { AnyObject } from '@/types/index'\nimport { load } from './load/load'\nimport { resolveReferences } from './resolve-references'\n\nconst EXAMPLE_FILE = path.join(new URL(import.meta.url).pathname, '../../../tests/filesystem/api/openapi.yaml')\n\ndescribe('resolveReferences', () => {\n it('resolves a single reference', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: '#/components/requestBodies/Foobar',\n },\n },\n },\n },\n components: {\n requestBodies: {\n Foobar: {\n content: {},\n },\n },\n },\n }\n\n // Run the specification through our new parser\n const { schema } = resolveReferences(specification)\n\n // Assertion\n expect(schema.paths['/foobar'].post.requestBody.content).not.toBe(undefined)\n })\n\n it('returns an error when a reference can\u2019t be found', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: '#/components/WrongReference',\n },\n },\n },\n },\n }\n\n // Run the specification through our new parser\n const { valid, errors } = resolveReferences(specification)\n\n // Assertion\n expect(errors).not.toBe(undefined)\n expect(errors).not.toStrictEqual([])\n expect(errors[0].message).toBe('Can\u2019t resolve reference: #/components/WrongReference')\n expect(errors.length).toBe(1)\n expect(valid).toBe(false)\n })\n\n it('returns an error when an external reference can\u2019t be found', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'foo/bar/foobar.yaml#/components/WrongReference',\n },\n },\n },\n },\n }\n\n // Run the specification through our new parser\n const { valid, errors } = resolveReferences(specification)\n\n // Assertion\n expect(errors).not.toBe(undefined)\n expect(errors).not.toStrictEqual([])\n expect(errors[0].message).toBe('Can\u2019t resolve external reference: foo/bar/foobar.yaml')\n expect(errors.length).toBe(1)\n expect(valid).toBe(false)\n })\n\n it('matches output of @apidevtools/swagger-parser', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: '#/components/requestBodies/Foobar',\n },\n },\n },\n },\n components: {\n requestBodies: {\n Foobar: {\n content: {},\n },\n },\n },\n }\n\n // Run the specification through the old parser\n const oldSchema = (await new Promise((resolve, reject) => {\n SwaggerParser.dereference(structuredClone(specification) as never, (error, result) => {\n if (error) {\n reject(error)\n }\n\n if (result === undefined) {\n reject('Couldn\u2019t parse the Swagger file.')\n\n return\n }\n resolve(result)\n })\n }).catch((error) => {\n console.error('[@apidevtools/swagger-parser]', error)\n })) as any\n\n // Run the specification through our new parser\n const newParser = resolveReferences(specification)\n\n // Assertion\n expect(newParser.schema.paths['/foobar'].post.requestBody).toMatchObject(\n oldSchema.paths['/foobar'].post.requestBody,\n )\n })\n\n it('resolves references inside references', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: '#/components/requestBodies/Foobar',\n },\n },\n },\n },\n\n components: {\n requestBodies: {\n CursorRequest: {\n content: {},\n },\n Foobar: {\n // This is a reference to another reference\n $ref: '#/components/requestBodies/CursorRequest',\n },\n },\n },\n }\n\n // Run the specification through the old parser\n const oldSchema = (await new Promise((resolve, reject) => {\n SwaggerParser.dereference(structuredClone(specification) as never, (error, result) => {\n if (error) {\n reject(error)\n }\n\n if (result === undefined) {\n reject('Couldn\u2019t parse the Swagger file.')\n\n return\n }\n resolve(result)\n })\n }).catch((error) => {\n console.error('[@apidevtools/swagger-parser]', error)\n })) as any\n\n // Run the specification through our new parser\n const newParser = resolveReferences(specification)\n\n // Assertion\n expect(newParser.schema.paths['/foobar'].post.requestBody).toMatchObject(\n oldSchema.paths['/foobar'].post.requestBody,\n )\n })\n\n it('resolves references in arrays', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: '#/components/requestBodies/Foobar',\n },\n },\n },\n },\n\n components: {\n schemas: {\n Barfoo: {\n type: 'string',\n example: 'barfoo',\n },\n },\n requestBodies: {\n Foobar: {\n content: {\n 'application/json': {\n schema: {\n oneOf: [\n {\n $ref: '#/components/schemas/Barfoo',\n },\n ],\n },\n },\n },\n },\n },\n },\n }\n\n // Run the specification through our new parser\n const { schema } = resolveReferences(specification)\n\n // Assertion\n expect(schema.paths['/foobar'].post.requestBody.content['application/json'].schema.oneOf[0]).toMatchObject({\n type: 'string',\n example: 'barfoo',\n })\n })\n\n it('merges original properties and referenced content', async () => {\n const specification = {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: '#/components/requestBodies/Foobar',\n },\n },\n },\n },\n components: {\n schemas: {\n Barfoo: {\n type: 'string',\n example: 'barfoo',\n },\n },\n requestBodies: {\n Foobar: {\n content: {\n 'application/json': {\n schema: {\n oneOf: [\n {\n description: 'This is a barfoo',\n $ref: '#/components/schemas/Barfoo',\n },\n ],\n },\n },\n },\n },\n },\n },\n }\n\n // Run the specification through our new parser\n const { schema } = resolveReferences(specification)\n\n // Assertion\n expect(schema.paths['/foobar'].post.requestBody.content['application/json'].schema.oneOf[0]).toMatchObject({\n type: 'string',\n example: 'barfoo',\n description: 'This is a barfoo',\n })\n })\n\n it('references inside references still keep the reference to the original JS object', async () => {\n const specification = {\n swagger: '2.0',\n info: {\n title: 'Branded Fares Upsell',\n version: '1.0.1',\n },\n paths: {\n '/foobar': {\n post: {\n responses: {\n '200': {\n $ref: '#/responses/returnUpsell',\n },\n },\n },\n },\n },\n responses: {\n returnUpsell: {\n schema: {\n type: 'object',\n properties: {\n dictionaries: {\n $ref: '#/definitions/LocationEntry',\n },\n },\n },\n },\n },\n definitions: {\n Dictionaries: {\n type: 'object',\n properties: {\n locations: {\n $ref: '#/definitions/LocationEntry',\n },\n },\n },\n LocationEntry: {\n additionalProperties: {\n $ref: '#/definitions/LocationValue',\n },\n },\n LocationValue: {\n properties: {\n cityCode: {\n description: 'City code associated to the airport',\n example: 'PAR',\n type: 'string',\n },\n },\n },\n },\n }\n\n // Run the specification through our new parser\n const { schema } = resolveReferences(specification)\n\n // Assertion\n expect(schema.swagger).toBe('2.0')\n expect(\n schema.paths['/foobar'].post.responses[200].schema.properties.dictionaries.additionalProperties,\n ).toMatchObject({\n properties: {\n cityCode: {\n description: 'City code associated to the airport',\n example: 'PAR',\n type: 'string',\n },\n },\n })\n })\n\n it('resolves a simple circular reference', async () => {\n const partialSpecification: AnyObject = {\n foo: {\n bar: {\n $ref: '#/foo',\n },\n },\n }\n\n const { schema } = resolveReferences(partialSpecification)\n\n // Circular references can\u2019t be JSON.stringify\u2019d (easily)\n expect(() => JSON.stringify(schema, null, 2)).toThrow()\n\n // Sky is the limit\n expect(schema.foo.bar.bar.bar.bar.bar.bar.bar.bar).toBeTypeOf('object')\n })\n\n it('resolves a more advanced circular reference', async () => {\n const partialSpecification: AnyObject = {\n type: 'object',\n properties: {\n element: { $ref: '#/schemas/element' },\n foobar: { $ref: '#/schemas/foobar' },\n },\n schemas: {\n element: {\n type: 'object',\n properties: {\n element: { $ref: '#/schemas/element' },\n },\n },\n foobar: {\n type: 'object',\n properties: {\n foobar: { $ref: '#/schemas/foobar' },\n },\n },\n },\n }\n\n // Typecasting: We\u2019re misusing the function and pass a partial specification only.\n const { schema } = resolveReferences(partialSpecification) as any\n\n // Circular references can\u2019t be JSON.stringify\u2019d (easily)\n expect(() => JSON.stringify(schema, null, 2)).toThrow()\n\n // Sky is the liit\n expect(schema.schemas.element.properties.element.properties.element.properties.element).toBeTypeOf('object')\n })\n\n it('resolves an OpenAPI-like circular reference', async () => {\n const specification = {\n type: 'object',\n properties: {\n element: { $ref: '#/schemas/element' },\n },\n schemas: {\n element: {\n type: 'object',\n properties: {\n element: { $ref: '#/schemas/element' },\n },\n },\n },\n }\n\n const { schema } = resolveReferences(specification)\n\n // Original specification should not be mutated\n expect(specification.properties.element.$ref).toBeTypeOf('string')\n\n // Circular dependency should be resolved\n expect(schema.properties.element.type).toBe('object')\n expect(schema.properties.element.properties.element.type).toBe('object')\n expect(schema.properties.element.properties.element.properties.element.type).toBe('object')\n\n // Circular references can\u2019t be JSON.stringify\u2019d (easily)\n expect(() => JSON.stringify(schema, null, 2)).toThrow()\n })\n\n it('composes two files', async () => {\n const filesystem = [\n {\n dir: '/Foobar',\n isEntrypoint: true,\n references: ['other/folder/foobar.json'],\n filename: 'openapi.json',\n specification: {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'other/folder/foobar.json',\n },\n },\n },\n },\n },\n },\n {\n dir: '/Foobar/other/folder',\n isEntrypoint: false,\n references: [],\n filename: 'other/folder/foobar.json',\n specification: {\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n },\n },\n ]\n\n const { schema } = resolveReferences(filesystem)\n\n expect(schema.paths['/foobar'].post.requestBody.content['application/json'].schema.example).toBe('foobar')\n })\n\n it('resolves reference to a part of an external file', async () => {\n const filesystem = [\n {\n dir: '/Foobar',\n isEntrypoint: true,\n references: ['other/folder/foobar.json'],\n filename: 'openapi.json',\n specification: {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'other/folder/foobar.json#/components/requestBodies/Foobar',\n },\n },\n },\n },\n },\n },\n {\n dir: '/Foobar/other/folder',\n isEntrypoint: false,\n references: [],\n filename: 'other/folder/foobar.json',\n specification: {\n components: {\n requestBodies: {\n Foobar: {\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n },\n },\n },\n },\n },\n ]\n\n const { schema } = resolveReferences(filesystem)\n expect(schema.paths['/foobar'].post.requestBody.content['application/json'].schema.example).toBe('foobar')\n })\n\n it('resolves references in external files', async () => {\n const filesystem = [\n {\n dir: '/Foobar',\n isEntrypoint: true,\n references: ['other/folder/foobar.json'],\n filename: 'openapi.json',\n specification: {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'other/folder/foobar.json#/components/requestBodies/Foobar',\n },\n },\n },\n },\n },\n },\n {\n dir: '/Foobar/other/folder',\n isEntrypoint: false,\n references: ['barfoo.json'],\n filename: 'other/folder/foobar.json',\n specification: {\n components: {\n requestBodies: {\n Foobar: {\n $ref: 'barfoo.json',\n },\n },\n },\n },\n },\n {\n dir: '/Foobar/other/folder',\n isEntrypoint: false,\n references: [],\n filename: 'barfoo.json',\n specification: {\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n },\n },\n ]\n\n const { schema } = resolveReferences(filesystem)\n expect(schema.paths['/foobar'].post.requestBody.content['application/json'].schema.example).toBe('foobar')\n })\n\n it('resolves from filesystem', async () => {\n const { filesystem } = await load(EXAMPLE_FILE, {\n plugins: [readFiles()],\n })\n\n const { schema } = resolveReferences(filesystem)\n\n // Resolve the *path* from the given file\n expect(schema.components.schemas.Upload.allOf[0].title).toBe('Coordinates')\n })\n\n it('resolves reference to self by filename', async () => {\n const filesystem = [\n {\n dir: '/Foobar',\n isEntrypoint: true,\n references: [],\n filename: 'openapi.json',\n specification: {\n openapi: '3.1.0',\n info: {},\n paths: {\n '/foobar': {\n post: {\n requestBody: {\n $ref: 'openapi.json#/components/requestBodies/Foobar',\n },\n },\n },\n },\n components: {\n requestBodies: {\n Foobar: {\n content: {\n 'application/json': {\n schema: {\n type: 'string',\n example: 'foobar',\n },\n },\n },\n },\n },\n },\n },\n },\n ]\n\n const { schema } = resolveReferences(filesystem)\n expect(schema.paths['/foobar'].post.requestBody.content['application/json'].schema.example).toBe('foobar')\n })\n})\n"],
5
- "mappings": "AAAA,OAAO,UAAU;AAKjB,OAAO,mBAAmB;AAC1B,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,iBAAiB;AAE1B,SAAS,YAAY;AACrB,SAAS,yBAAyB;AAElC,MAAM,eAAe,KAAK,KAAK,IAAI,IAAI,YAAY,GAAG,EAAE,UAAU,4CAA4C;AAE9G,SAAS,qBAAqB,MAAM;AAClC,KAAG,+BAA+B,YAAY;AAC5C,UAAM,gBAAgB;AAAA,MACpB,SAAS;AAAA,MACT,M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