@scalar/openapi-parser 0.23.11 → 0.23.13
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.
- package/CHANGELOG.md +19 -0
- package/dist/configuration/index.d.ts +1 -0
- package/dist/configuration/index.d.ts.map +1 -1
- package/dist/configuration/index.js +1 -1
- package/dist/configuration/index.js.map +2 -2
- package/dist/utils/resolve-references.js +11 -0
- package/dist/utils/resolve-references.js.map +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @scalar/openapi-parser
|
|
2
2
|
|
|
3
|
+
## 0.23.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
#### Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- **@scalar/openapi-upgrader@0.1.7**
|
|
10
|
+
- [#7739](https://github.com/scalar/scalar/pull/7739): fix: upgrade form to multipart/form
|
|
11
|
+
- [#7694](https://github.com/scalar/scalar/pull/7694): feat: migrate x-example and x-examples
|
|
12
|
+
|
|
13
|
+
- **@scalar/json-magic@0.9.0**
|
|
14
|
+
- [#7701](https://github.com/scalar/scalar/pull/7701): Made bundle external document extensions configurable
|
|
15
|
+
|
|
16
|
+
## 0.23.12
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#7719](https://github.com/scalar/scalar/pull/7719): fix: self-referencing causes infinite loop in `dereference`
|
|
21
|
+
|
|
3
22
|
## 0.23.11
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -5300,6 +5300,7 @@ export declare const ERRORS: {
|
|
|
5300
5300
|
readonly OPENAPI_VERSION_NOT_SUPPORTED: "Can't find supported Swagger/OpenAPI version in the provided document, version must be a string.";
|
|
5301
5301
|
readonly INVALID_REFERENCE: "Can't resolve reference: %s";
|
|
5302
5302
|
readonly EXTERNAL_REFERENCE_NOT_FOUND: "Can't resolve external reference: %s";
|
|
5303
|
+
readonly SELF_REFERENCE: "Can't resolve reference to itself: %s";
|
|
5303
5304
|
readonly FILE_DOES_NOT_EXIST: "File does not exist: %s";
|
|
5304
5305
|
readonly NO_CONTENT: "No content found";
|
|
5305
5306
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
12
12
|
const ERRORS = {
|
|
13
13
|
EMPTY_OR_INVALID: "Can't find JSON, YAML or filename in data.",
|
|
14
|
-
// URI_MUST_BE_STRING: 'uri parameter or $id attribute must be a string',
|
|
15
14
|
OPENAPI_VERSION_NOT_SUPPORTED: "Can't find supported Swagger/OpenAPI version in the provided document, version must be a string.",
|
|
16
15
|
INVALID_REFERENCE: "Can't resolve reference: %s",
|
|
17
16
|
EXTERNAL_REFERENCE_NOT_FOUND: "Can't resolve external reference: %s",
|
|
17
|
+
SELF_REFERENCE: "Can't resolve reference to itself: %s",
|
|
18
18
|
FILE_DOES_NOT_EXIST: "File does not exist: %s",
|
|
19
19
|
NO_CONTENT: "No content found"
|
|
20
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/configuration/index.ts"],
|
|
4
|
-
"sourcesContent": ["import Swagger20 from '@/schemas/v2.0/schema'\nimport OpenApi30 from '@/schemas/v3.0/schema'\nimport OpenApi31 from '@/schemas/v3.1/schema'\nimport OpenApi32 from '@/schemas/v3.2/schema'\n\n/**\n * A list of the supported OpenAPI specifications\n */\nexport const OpenApiSpecifications = {\n '2.0': Swagger20,\n '3.0': OpenApi30,\n '3.1': OpenApi31,\n '3.2': OpenApi32,\n}\n\nexport type OpenApiVersion = keyof typeof OpenApiSpecifications\n\nexport const OpenApiVersions = Object.keys(OpenApiSpecifications) as OpenApiVersion[]\n\n/**\n * List of error messages used in the Validator\n */\nexport const ERRORS = {\n EMPTY_OR_INVALID: \"Can't find JSON, YAML or filename in data.\",\n
|
|
5
|
-
"mappings": "AAAA,OAAO,eAAe;AACtB,OAAO,eAAe;AACtB,OAAO,eAAe;AACtB,OAAO,eAAe;AAKf,MAAM,wBAAwB;AAAA,EACnC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;AAIO,MAAM,kBAAkB,OAAO,KAAK,qBAAqB;AAKzD,MAAM,SAAS;AAAA,EACpB,kBAAkB;AAAA
|
|
4
|
+
"sourcesContent": ["import Swagger20 from '@/schemas/v2.0/schema'\nimport OpenApi30 from '@/schemas/v3.0/schema'\nimport OpenApi31 from '@/schemas/v3.1/schema'\nimport OpenApi32 from '@/schemas/v3.2/schema'\n\n/**\n * A list of the supported OpenAPI specifications\n */\nexport const OpenApiSpecifications = {\n '2.0': Swagger20,\n '3.0': OpenApi30,\n '3.1': OpenApi31,\n '3.2': OpenApi32,\n}\n\nexport type OpenApiVersion = keyof typeof OpenApiSpecifications\n\nexport const OpenApiVersions = Object.keys(OpenApiSpecifications) as OpenApiVersion[]\n\n/**\n * List of error messages used in the Validator\n */\nexport const ERRORS = {\n EMPTY_OR_INVALID: \"Can't find JSON, YAML or filename in data.\",\n OPENAPI_VERSION_NOT_SUPPORTED:\n \"Can't find supported Swagger/OpenAPI version in the provided document, version must be a string.\",\n INVALID_REFERENCE: \"Can't resolve reference: %s\",\n EXTERNAL_REFERENCE_NOT_FOUND: \"Can't resolve external reference: %s\",\n SELF_REFERENCE: \"Can't resolve reference to itself: %s\",\n FILE_DOES_NOT_EXIST: 'File does not exist: %s',\n NO_CONTENT: 'No content found',\n} as const\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,eAAe;AACtB,OAAO,eAAe;AACtB,OAAO,eAAe;AACtB,OAAO,eAAe;AAKf,MAAM,wBAAwB;AAAA,EACnC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;AAIO,MAAM,kBAAkB,OAAO,KAAK,qBAAqB;AAKzD,MAAM,SAAS;AAAA,EACpB,kBAAkB;AAAA,EAClB,+BACE;AAAA,EACF,mBAAmB;AAAA,EACnB,8BAA8B;AAAA,EAC9B,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,YAAY;AACd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,7 +37,18 @@ function dereference(schema, filesystem, entrypoint, resolvedSchemas, errors, op
|
|
|
37
37
|
dereference(externalFile.specification, filesystem, externalFile, resolvedSchemas, errors, options);
|
|
38
38
|
return externalFile;
|
|
39
39
|
}
|
|
40
|
+
const processedRefs = /* @__PURE__ */ new Set();
|
|
40
41
|
while (schema.$ref !== void 0) {
|
|
42
|
+
const selfReferenceDetected = processedRefs.has(schema.$ref);
|
|
43
|
+
if (selfReferenceDetected) {
|
|
44
|
+
errors.push({
|
|
45
|
+
code: "SELF_REFERENCE",
|
|
46
|
+
message: ERRORS.SELF_REFERENCE.replace("%s", schema.$ref)
|
|
47
|
+
});
|
|
48
|
+
delete schema.$ref;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
processedRefs.add(schema.$ref);
|
|
41
52
|
const resolved = resolveUri(schema.$ref, options, entrypoint, filesystem, resolveExternal, errors);
|
|
42
53
|
if (typeof resolved !== "object" || resolved === null) {
|
|
43
54
|
break;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/resolve-references.ts"],
|
|
4
|
-
"sourcesContent": ["import type { OpenAPI } from '@scalar/openapi-types'\n\nimport { ERRORS } from '@/configuration'\nimport type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '@/types/index'\n\nimport { getEntrypoint } from './get-entrypoint'\nimport { getSegmentsFromPath } from './get-segments-from-path'\nimport { isObject } from './is-object'\nimport { makeFilesystem } from './make-filesystem'\n\n// TODO: Add support for all pointer words\n// export const pointerWords = new Set([\n// '$ref',\n// '$id',\n// '$anchor',\n// '$dynamicRef',\n// '$dynamicAnchor',\n// '$schema',\n// ])\n\ntype ResolveReferencesResult = {\n valid: boolean\n errors: ErrorObject[]\n schema: OpenAPI.Document\n}\n\nexport type ResolveReferencesOptions = ThrowOnErrorOption & {\n /**\n * Fired when dereferenced a schema.\n *\n * Note that for object schemas, its properties may not be dereferenced when the hook is called.\n */\n onDereference?: (data: { schema: AnyObject; ref: string }) => void\n}\n\n/**\n * Takes a specification and resolves all references.\n */\nexport function resolveReferences(\n // Just a specification, or a set of files.\n input: AnyObject | Filesystem,\n // Additional options to control the behaviour\n options?: ResolveReferencesOptions,\n // Fallback to the entrypoint\n file?: FilesystemEntry,\n // Errors that occurred during the process\n errors: ErrorObject[] = [],\n): ResolveReferencesResult {\n // Detach from input\n const clonedInput = structuredClone(input)\n\n // Make it a filesystem, even if it's just one file\n const filesystem = makeFilesystem(clonedInput)\n\n // Get the main file\n const entrypoint = getEntrypoint(filesystem)\n\n const finalInput = file?.specification ?? entrypoint.specification\n\n // Does it look like an OpenAPI document?\n if (!isObject(finalInput)) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.NO_CONTENT)\n }\n\n return {\n valid: false,\n errors,\n schema: finalInput as OpenAPI.Document,\n }\n }\n\n // Recursively resolve all references\n dereference(finalInput, filesystem, file ?? entrypoint, new WeakSet(), errors, options)\n\n // Remove duplicates (according to message) from errors\n errors = errors.filter(\n (error, index, self) => index === self.findIndex((t) => t.message === error.message && t.code === error.code),\n )\n\n // Return the resolved specification\n return {\n valid: errors.length === 0,\n errors,\n schema: finalInput as OpenAPI.Document,\n }\n}\n\n/**\n * Resolves the circular reference to an object and deletes the $ref properties (in-place).\n */\nfunction dereference(\n schema: AnyObject,\n filesystem: Filesystem,\n entrypoint: FilesystemEntry,\n // references to resolved object\n resolvedSchemas: WeakSet<object>,\n // error output\n errors: ErrorObject[],\n\n options?: ResolveReferencesOptions,\n): void {\n if (schema === null || resolvedSchemas.has(schema)) {\n return\n }\n resolvedSchemas.add(schema)\n\n function resolveExternal(externalFile: FilesystemEntry) {\n dereference(externalFile.specification, filesystem, externalFile, resolvedSchemas, errors, options)\n\n return externalFile\n }\n\n while (schema.$ref !== undefined) {\n // Find the referenced content\n const resolved = resolveUri(schema.$ref, options, entrypoint, filesystem, resolveExternal, errors)\n\n // invalid\n if (typeof resolved !== 'object' || resolved === null) {\n break\n }\n const dereferencedRef = schema.$ref\n\n // Get rid of the reference\n delete schema.$ref\n\n for (const key of Object.keys(resolved)) {\n if (schema[key] === undefined) {\n schema[key] = resolved[key]\n }\n }\n\n if (dereferencedRef) {\n options?.onDereference?.({ schema, ref: dereferencedRef })\n }\n }\n\n // Iterate over the whole object\n for (const value of Object.values(schema)) {\n if (typeof value === 'object' && value !== null) {\n dereference(value, filesystem, entrypoint, resolvedSchemas, errors, options)\n }\n }\n}\n\n/**\n * Resolves a URI to a part of the specification\n *\n * The output is not necessarily dereferenced\n */\nfunction resolveUri(\n // 'foobar.json#/foo/bar'\n uri: string,\n options: ResolveReferencesOptions,\n // { filename: './foobar.json '}\n file: FilesystemEntry,\n // [ { filename: './foobar.json '} ]\n filesystem: Filesystem,\n\n // a function to resolve references in external file\n resolve: (file: FilesystemEntry) => FilesystemEntry,\n\n errors: ErrorObject[],\n): AnyObject | undefined {\n // Ignore invalid URIs\n if (typeof uri !== 'string') {\n if (options?.throwOnError) {\n throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri))\n }\n\n errors.push({\n code: 'INVALID_REFERENCE',\n message: ERRORS.INVALID_REFERENCE.replace('%s', uri),\n })\n\n return undefined\n }\n\n // Understand the URI\n const [prefix, path] = uri.split('#', 2)\n\n /** Check whether the file is pointing to itself */\n const isDifferentFile = prefix !== file.filename\n\n // External references\n if (prefix && isDifferentFile) {\n const externalReference = filesystem.find((entry) => {\n return entry.filename === prefix\n })\n\n if (!externalReference) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix))\n }\n\n errors.push({\n code: 'EXTERNAL_REFERENCE_NOT_FOUND',\n message: ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix),\n })\n\n return undefined\n }\n // $ref: 'other-file.yaml'\n if (path === undefined) {\n return externalReference.specification\n }\n\n // $ref: 'other-file.yaml#/foo/bar'\n // resolve refs first before accessing properties directly\n return resolveUri(`#${path}`, options, resolve(externalReference), filesystem, resolve, errors)\n }\n\n // Pointers\n const segments = getSegmentsFromPath(path)\n\n // Try to find the URI\n try {\n return segments.reduce((acc, key) => {\n return acc[key]\n }, file.specification)\n } catch (_error) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri))\n }\n\n errors.push({\n code: 'INVALID_REFERENCE',\n message: ERRORS.INVALID_REFERENCE.replace('%s', uri),\n })\n }\n\n return undefined\n}\n"],
|
|
5
|
-
"mappings": "AAEA,SAAS,cAAc;AAGvB,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AA8BxB,SAAS,kBAEd,OAEA,SAEA,MAEA,SAAwB,CAAC,GACA;AAEzB,QAAM,cAAc,gBAAgB,KAAK;AAGzC,QAAM,aAAa,eAAe,WAAW;AAG7C,QAAM,aAAa,cAAc,UAAU;AAE3C,QAAM,aAAa,MAAM,iBAAiB,WAAW;AAGrD,MAAI,CAAC,SAAS,UAAU,GAAG;AACzB,QAAI,SAAS,cAAc;AACzB,YAAM,IAAI,MAAM,OAAO,UAAU;AAAA,IACnC;AAEA,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,QAAQ;AAAA,IACV;AAAA,EACF;AAGA,cAAY,YAAY,YAAY,QAAQ,YAAY,oBAAI,QAAQ,GAAG,QAAQ,OAAO;AAGtF,WAAS,OAAO;AAAA,IACd,CAAC,OAAO,OAAO,SAAS,UAAU,KAAK,UAAU,CAAC,MAAM,EAAE,YAAY,MAAM,WAAW,EAAE,SAAS,MAAM,IAAI;AAAA,EAC9G;AAGA,SAAO;AAAA,IACL,OAAO,OAAO,WAAW;AAAA,IACzB;AAAA,IACA,QAAQ;AAAA,EACV;AACF;AAKA,SAAS,YACP,QACA,YACA,YAEA,iBAEA,QAEA,SACM;AACN,MAAI,WAAW,QAAQ,gBAAgB,IAAI,MAAM,GAAG;AAClD;AAAA,EACF;AACA,kBAAgB,IAAI,MAAM;AAE1B,WAAS,gBAAgB,cAA+B;AACtD,gBAAY,aAAa,eAAe,YAAY,cAAc,iBAAiB,QAAQ,OAAO;AAElG,WAAO;AAAA,EACT;
|
|
4
|
+
"sourcesContent": ["import type { OpenAPI } from '@scalar/openapi-types'\n\nimport { ERRORS } from '@/configuration'\nimport type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '@/types/index'\n\nimport { getEntrypoint } from './get-entrypoint'\nimport { getSegmentsFromPath } from './get-segments-from-path'\nimport { isObject } from './is-object'\nimport { makeFilesystem } from './make-filesystem'\n\n// TODO: Add support for all pointer words\n// export const pointerWords = new Set([\n// '$ref',\n// '$id',\n// '$anchor',\n// '$dynamicRef',\n// '$dynamicAnchor',\n// '$schema',\n// ])\n\ntype ResolveReferencesResult = {\n valid: boolean\n errors: ErrorObject[]\n schema: OpenAPI.Document\n}\n\nexport type ResolveReferencesOptions = ThrowOnErrorOption & {\n /**\n * Fired when dereferenced a schema.\n *\n * Note that for object schemas, its properties may not be dereferenced when the hook is called.\n */\n onDereference?: (data: { schema: AnyObject; ref: string }) => void\n}\n\n/**\n * Takes a specification and resolves all references.\n */\nexport function resolveReferences(\n // Just a specification, or a set of files.\n input: AnyObject | Filesystem,\n // Additional options to control the behaviour\n options?: ResolveReferencesOptions,\n // Fallback to the entrypoint\n file?: FilesystemEntry,\n // Errors that occurred during the process\n errors: ErrorObject[] = [],\n): ResolveReferencesResult {\n // Detach from input\n const clonedInput = structuredClone(input)\n\n // Make it a filesystem, even if it's just one file\n const filesystem = makeFilesystem(clonedInput)\n\n // Get the main file\n const entrypoint = getEntrypoint(filesystem)\n\n const finalInput = file?.specification ?? entrypoint.specification\n\n // Does it look like an OpenAPI document?\n if (!isObject(finalInput)) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.NO_CONTENT)\n }\n\n return {\n valid: false,\n errors,\n schema: finalInput as OpenAPI.Document,\n }\n }\n\n // Recursively resolve all references\n dereference(finalInput, filesystem, file ?? entrypoint, new WeakSet(), errors, options)\n\n // Remove duplicates (according to message) from errors\n errors = errors.filter(\n (error, index, self) => index === self.findIndex((t) => t.message === error.message && t.code === error.code),\n )\n\n // Return the resolved specification\n return {\n valid: errors.length === 0,\n errors,\n schema: finalInput as OpenAPI.Document,\n }\n}\n\n/**\n * Resolves the circular reference to an object and deletes the $ref properties (in-place).\n */\nfunction dereference(\n schema: AnyObject,\n filesystem: Filesystem,\n entrypoint: FilesystemEntry,\n // references to resolved object\n resolvedSchemas: WeakSet<object>,\n // error output\n errors: ErrorObject[],\n\n options?: ResolveReferencesOptions,\n): void {\n if (schema === null || resolvedSchemas.has(schema)) {\n return\n }\n resolvedSchemas.add(schema)\n\n function resolveExternal(externalFile: FilesystemEntry) {\n dereference(externalFile.specification, filesystem, externalFile, resolvedSchemas, errors, options)\n\n return externalFile\n }\n\n /**\n * Track seen $ref paths to detect self-referencing schemas.\n *\n * This only tracks $refs within the current while loop (one resolution chain).\n * Each schema object gets its own fresh processedRefs when dereference() is called.\n *\n * This catches invalid cases like:\n * Test: { $ref: '#/components/schemas/Test' }\n *\n * But allows valid recursive schemas where the $ref is nested:\n * Person: { type: 'object', properties: { friend: { $ref: '#/components/schemas/Person' } } }\n */\n const processedRefs = new Set<string>()\n\n while (schema.$ref !== undefined) {\n const selfReferenceDetected = processedRefs.has(schema.$ref)\n\n if (selfReferenceDetected) {\n errors.push({\n code: 'SELF_REFERENCE',\n message: ERRORS.SELF_REFERENCE.replace('%s', schema.$ref),\n })\n\n delete schema.$ref\n\n break\n }\n\n processedRefs.add(schema.$ref)\n\n // Find the referenced content\n const resolved = resolveUri(schema.$ref, options, entrypoint, filesystem, resolveExternal, errors)\n\n // invalid\n if (typeof resolved !== 'object' || resolved === null) {\n break\n }\n const dereferencedRef = schema.$ref\n\n // Get rid of the reference\n delete schema.$ref\n\n for (const key of Object.keys(resolved)) {\n if (schema[key] === undefined) {\n schema[key] = resolved[key]\n }\n }\n\n if (dereferencedRef) {\n options?.onDereference?.({ schema, ref: dereferencedRef })\n }\n }\n\n // Iterate over the whole object\n for (const value of Object.values(schema)) {\n if (typeof value === 'object' && value !== null) {\n dereference(value, filesystem, entrypoint, resolvedSchemas, errors, options)\n }\n }\n}\n\n/**\n * Resolves a URI to a part of the specification\n *\n * The output is not necessarily dereferenced\n */\nfunction resolveUri(\n // 'foobar.json#/foo/bar'\n uri: string,\n options: ResolveReferencesOptions,\n // { filename: './foobar.json '}\n file: FilesystemEntry,\n // [ { filename: './foobar.json '} ]\n filesystem: Filesystem,\n\n // a function to resolve references in external file\n resolve: (file: FilesystemEntry) => FilesystemEntry,\n\n errors: ErrorObject[],\n): AnyObject | undefined {\n // Ignore invalid URIs\n if (typeof uri !== 'string') {\n if (options?.throwOnError) {\n throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri))\n }\n\n errors.push({\n code: 'INVALID_REFERENCE',\n message: ERRORS.INVALID_REFERENCE.replace('%s', uri),\n })\n\n return undefined\n }\n\n // Understand the URI\n const [prefix, path] = uri.split('#', 2)\n\n /** Check whether the file is pointing to itself */\n const isDifferentFile = prefix !== file.filename\n\n // External references\n if (prefix && isDifferentFile) {\n const externalReference = filesystem.find((entry) => {\n return entry.filename === prefix\n })\n\n if (!externalReference) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix))\n }\n\n errors.push({\n code: 'EXTERNAL_REFERENCE_NOT_FOUND',\n message: ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix),\n })\n\n return undefined\n }\n // $ref: 'other-file.yaml'\n if (path === undefined) {\n return externalReference.specification\n }\n\n // $ref: 'other-file.yaml#/foo/bar'\n // resolve refs first before accessing properties directly\n return resolveUri(`#${path}`, options, resolve(externalReference), filesystem, resolve, errors)\n }\n\n // Pointers\n const segments = getSegmentsFromPath(path)\n\n // Try to find the URI\n try {\n return segments.reduce((acc, key) => {\n return acc[key]\n }, file.specification)\n } catch (_error) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri))\n }\n\n errors.push({\n code: 'INVALID_REFERENCE',\n message: ERRORS.INVALID_REFERENCE.replace('%s', uri),\n })\n }\n\n return undefined\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,cAAc;AAGvB,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AA8BxB,SAAS,kBAEd,OAEA,SAEA,MAEA,SAAwB,CAAC,GACA;AAEzB,QAAM,cAAc,gBAAgB,KAAK;AAGzC,QAAM,aAAa,eAAe,WAAW;AAG7C,QAAM,aAAa,cAAc,UAAU;AAE3C,QAAM,aAAa,MAAM,iBAAiB,WAAW;AAGrD,MAAI,CAAC,SAAS,UAAU,GAAG;AACzB,QAAI,SAAS,cAAc;AACzB,YAAM,IAAI,MAAM,OAAO,UAAU;AAAA,IACnC;AAEA,WAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,QAAQ;AAAA,IACV;AAAA,EACF;AAGA,cAAY,YAAY,YAAY,QAAQ,YAAY,oBAAI,QAAQ,GAAG,QAAQ,OAAO;AAGtF,WAAS,OAAO;AAAA,IACd,CAAC,OAAO,OAAO,SAAS,UAAU,KAAK,UAAU,CAAC,MAAM,EAAE,YAAY,MAAM,WAAW,EAAE,SAAS,MAAM,IAAI;AAAA,EAC9G;AAGA,SAAO;AAAA,IACL,OAAO,OAAO,WAAW;AAAA,IACzB;AAAA,IACA,QAAQ;AAAA,EACV;AACF;AAKA,SAAS,YACP,QACA,YACA,YAEA,iBAEA,QAEA,SACM;AACN,MAAI,WAAW,QAAQ,gBAAgB,IAAI,MAAM,GAAG;AAClD;AAAA,EACF;AACA,kBAAgB,IAAI,MAAM;AAE1B,WAAS,gBAAgB,cAA+B;AACtD,gBAAY,aAAa,eAAe,YAAY,cAAc,iBAAiB,QAAQ,OAAO;AAElG,WAAO;AAAA,EACT;AAcA,QAAM,gBAAgB,oBAAI,IAA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vC,QAAM,kBAAkB,WAAW,KAAK;AAGxC,MAAI,UAAU,iBAAiB;AAC7B,UAAM,oBAAoB,WAAW,KAAK,CAAC,UAAU;AACnD,aAAO,MAAM,aAAa;AAAA,IAC5B,CAAC;AAED,QAAI,CAAC,mBAAmB;AACtB,UAAI,SAAS,cAAc;AACzB,cAAM,IAAI,MAAM,OAAO,6BAA6B,QAAQ,MAAM,MAAM,CAAC;AAAA,MAC3E;AAEA,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,SAAS,OAAO,6BAA6B,QAAQ,MAAM,MAAM;AAAA,MACnE,CAAC;AAED,aAAO;AAAA,IACT;AAEA,QAAI,SAAS,QAAW;AACtB,aAAO,kBAAkB;AAAA,IAC3B;AAIA,WAAO,WAAW,IAAI,IAAI,IAAI,SAAS,QAAQ,iBAAiB,GAAG,YAAY,SAAS,MAAM;AAAA,EAChG;AAGA,QAAM,WAAW,oBAAoB,IAAI;AAGzC,MAAI;AACF,WAAO,SAAS,OAAO,CAAC,KAAK,QAAQ;AACnC,aAAO,IAAI,GAAG;AAAA,IAChB,GAAG,KAAK,aAAa;AAAA,EACvB,SAAS,QAAQ;AACf,QAAI,SAAS,cAAc;AACzB,YAAM,IAAI,MAAM,OAAO,kBAAkB,QAAQ,MAAM,GAAG,CAAC;AAAA,IAC7D;AAEA,WAAO,KAAK;AAAA,MACV,MAAM;AAAA,MACN,SAAS,OAAO,kBAAkB,QAAQ,MAAM,GAAG;AAAA,IACrD,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"parser",
|
|
18
18
|
"typescript"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.23.
|
|
20
|
+
"version": "0.23.13",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
"jsonpointer": "^5.0.1",
|
|
55
55
|
"leven": "^4.0.0",
|
|
56
56
|
"yaml": "^2.8.0",
|
|
57
|
-
"@scalar/json-magic": "0.8.10",
|
|
58
57
|
"@scalar/openapi-types": "0.5.3",
|
|
59
|
-
"@scalar/
|
|
58
|
+
"@scalar/json-magic": "0.9.0",
|
|
59
|
+
"@scalar/openapi-upgrader": "0.1.7"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@apidevtools/swagger-parser": "10.1.0",
|
|
63
63
|
"@types/node": "^22.9.0",
|
|
64
64
|
"just-diff": "^6.0.2",
|
|
65
65
|
"vite": "7.1.11",
|
|
66
|
-
"@scalar/
|
|
67
|
-
"@scalar/
|
|
66
|
+
"@scalar/build-tooling": "0.4.1",
|
|
67
|
+
"@scalar/types": "0.5.7"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "scalar-build-esbuild",
|