@speclynx/apidom-reference 2.6.0 → 2.6.1
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 +7 -0
- package/dist/apidom-reference.browser.js +78965 -78942
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +25 -25
- package/src/bundle/index.cjs +1 -1
- package/src/bundle/index.mjs +1 -1
- package/src/dereference/index.cjs +1 -1
- package/src/dereference/index.mjs +1 -1
- package/src/dereference/strategies/openapi-3-0/visitor.cjs +1 -1
- package/src/dereference/strategies/openapi-3-0/visitor.mjs +1 -1
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +1 -1
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +1 -1
- package/src/errors/InvalidJsonSchema$anchorError.cjs +1 -1
- package/src/errors/InvalidJsonSchema$anchorError.mjs +1 -1
- package/src/errors/UnmatchedParserError.cjs +11 -0
- package/src/errors/UnmatchedParserError.mjs +6 -0
- package/src/index.cjs +3 -1
- package/src/index.mjs +1 -0
- package/src/parse/index.cjs +3 -3
- package/src/parse/index.mjs +3 -3
- package/src/resolve/index.cjs +2 -2
- package/src/resolve/index.mjs +2 -2
- package/src/resolve/strategies/apidom/index.cjs +1 -1
- package/src/resolve/strategies/apidom/index.mjs +1 -1
- package/src/resolve/strategies/asyncapi-2/index.cjs +1 -1
- package/src/resolve/strategies/asyncapi-2/index.mjs +1 -1
- package/src/resolve/strategies/openapi-2/index.cjs +1 -1
- package/src/resolve/strategies/openapi-2/index.mjs +1 -1
- package/src/resolve/strategies/openapi-3-0/index.cjs +1 -1
- package/src/resolve/strategies/openapi-3-0/index.mjs +1 -1
- package/src/resolve/strategies/openapi-3-1/index.cjs +1 -1
- package/src/resolve/strategies/openapi-3-1/index.mjs +1 -1
- package/src/resolve/util.cjs +1 -1
- package/src/resolve/util.mjs +1 -1
- package/types/apidom-reference.d.ts +6 -0
- package/types/errors/UnmatchedParserError.d.ts +7 -0
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speclynx/apidom-reference",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Advanced algorithms for semantic ApiDOM manipulations like dereferencing or resolution.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -231,29 +231,29 @@
|
|
|
231
231
|
"license": "Apache-2.0",
|
|
232
232
|
"dependencies": {
|
|
233
233
|
"@babel/runtime-corejs3": "^7.28.4",
|
|
234
|
-
"@speclynx/apidom-core": "^2.6.
|
|
235
|
-
"@speclynx/apidom-datamodel": "^2.6.
|
|
236
|
-
"@speclynx/apidom-error": "^2.6.
|
|
237
|
-
"@speclynx/apidom-json-pointer": "^2.6.
|
|
238
|
-
"@speclynx/apidom-ns-arazzo-1": "^2.6.
|
|
239
|
-
"@speclynx/apidom-ns-asyncapi-2": "^2.6.
|
|
240
|
-
"@speclynx/apidom-ns-json-schema-2020-12": "^2.6.
|
|
241
|
-
"@speclynx/apidom-ns-openapi-2": "^2.6.
|
|
242
|
-
"@speclynx/apidom-ns-openapi-3-0": "^2.6.
|
|
243
|
-
"@speclynx/apidom-ns-openapi-3-1": "^2.6.
|
|
244
|
-
"@speclynx/apidom-parser-adapter-arazzo-json-1": "^2.6.
|
|
245
|
-
"@speclynx/apidom-parser-adapter-arazzo-yaml-1": "^2.6.
|
|
246
|
-
"@speclynx/apidom-parser-adapter-asyncapi-json-2": "^2.6.
|
|
247
|
-
"@speclynx/apidom-parser-adapter-asyncapi-yaml-2": "^2.6.
|
|
248
|
-
"@speclynx/apidom-parser-adapter-json": "^2.6.
|
|
249
|
-
"@speclynx/apidom-parser-adapter-openapi-json-2": "^2.6.
|
|
250
|
-
"@speclynx/apidom-parser-adapter-openapi-json-3-0": "^2.6.
|
|
251
|
-
"@speclynx/apidom-parser-adapter-openapi-json-3-1": "^2.6.
|
|
252
|
-
"@speclynx/apidom-parser-adapter-openapi-yaml-2": "^2.6.
|
|
253
|
-
"@speclynx/apidom-parser-adapter-openapi-yaml-3-0": "^2.6.
|
|
254
|
-
"@speclynx/apidom-parser-adapter-openapi-yaml-3-1": "^2.6.
|
|
255
|
-
"@speclynx/apidom-parser-adapter-yaml-1-2": "^2.6.
|
|
256
|
-
"@speclynx/apidom-traverse": "^2.6.
|
|
234
|
+
"@speclynx/apidom-core": "^2.6.1",
|
|
235
|
+
"@speclynx/apidom-datamodel": "^2.6.1",
|
|
236
|
+
"@speclynx/apidom-error": "^2.6.1",
|
|
237
|
+
"@speclynx/apidom-json-pointer": "^2.6.1",
|
|
238
|
+
"@speclynx/apidom-ns-arazzo-1": "^2.6.1",
|
|
239
|
+
"@speclynx/apidom-ns-asyncapi-2": "^2.6.1",
|
|
240
|
+
"@speclynx/apidom-ns-json-schema-2020-12": "^2.6.1",
|
|
241
|
+
"@speclynx/apidom-ns-openapi-2": "^2.6.1",
|
|
242
|
+
"@speclynx/apidom-ns-openapi-3-0": "^2.6.1",
|
|
243
|
+
"@speclynx/apidom-ns-openapi-3-1": "^2.6.1",
|
|
244
|
+
"@speclynx/apidom-parser-adapter-arazzo-json-1": "^2.6.1",
|
|
245
|
+
"@speclynx/apidom-parser-adapter-arazzo-yaml-1": "^2.6.1",
|
|
246
|
+
"@speclynx/apidom-parser-adapter-asyncapi-json-2": "^2.6.1",
|
|
247
|
+
"@speclynx/apidom-parser-adapter-asyncapi-yaml-2": "^2.6.1",
|
|
248
|
+
"@speclynx/apidom-parser-adapter-json": "^2.6.1",
|
|
249
|
+
"@speclynx/apidom-parser-adapter-openapi-json-2": "^2.6.1",
|
|
250
|
+
"@speclynx/apidom-parser-adapter-openapi-json-3-0": "^2.6.1",
|
|
251
|
+
"@speclynx/apidom-parser-adapter-openapi-json-3-1": "^2.6.1",
|
|
252
|
+
"@speclynx/apidom-parser-adapter-openapi-yaml-2": "^2.6.1",
|
|
253
|
+
"@speclynx/apidom-parser-adapter-openapi-yaml-3-0": "^2.6.1",
|
|
254
|
+
"@speclynx/apidom-parser-adapter-openapi-yaml-3-1": "^2.6.1",
|
|
255
|
+
"@speclynx/apidom-parser-adapter-yaml-1-2": "^2.6.1",
|
|
256
|
+
"@speclynx/apidom-traverse": "^2.6.1",
|
|
257
257
|
"@swaggerexpert/arazzo-runtime-expression": "^2.0.2",
|
|
258
258
|
"axios": "^1.13.0",
|
|
259
259
|
"minimatch": "^7.4.6",
|
|
@@ -274,5 +274,5 @@
|
|
|
274
274
|
"README.md",
|
|
275
275
|
"CHANGELOG.md"
|
|
276
276
|
],
|
|
277
|
-
"gitHead": "
|
|
277
|
+
"gitHead": "bac6186b9bca75fd7deac283c3fb042559eea5fb"
|
|
278
278
|
}
|
package/src/bundle/index.cjs
CHANGED
|
@@ -45,7 +45,7 @@ const bundle = async (uri, options) => {
|
|
|
45
45
|
|
|
46
46
|
// we couldn't find any bundle strategy for this File
|
|
47
47
|
if ((0, _ramda.isEmpty)(bundleStrategies)) {
|
|
48
|
-
throw new _UnmatchedBundleStrategyError.default(file.uri);
|
|
48
|
+
throw new _UnmatchedBundleStrategyError.default(`Could not find a bundle strategy that can bundle the file "${file.uri}"`);
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
51
|
const {
|
package/src/bundle/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ const bundle = async (uri, options) => {
|
|
|
39
39
|
|
|
40
40
|
// we couldn't find any bundle strategy for this File
|
|
41
41
|
if (isEmpty(bundleStrategies)) {
|
|
42
|
-
throw new UnmatchedBundleStrategyError(file.uri);
|
|
42
|
+
throw new UnmatchedBundleStrategyError(`Could not find a bundle strategy that can bundle the file "${file.uri}"`);
|
|
43
43
|
}
|
|
44
44
|
try {
|
|
45
45
|
const {
|
|
@@ -37,7 +37,7 @@ const dereferenceApiDOM = async (element, options) => {
|
|
|
37
37
|
|
|
38
38
|
// we couldn't find any dereference strategy for this File
|
|
39
39
|
if ((0, _ramda.isEmpty)(dereferenceStrategies)) {
|
|
40
|
-
throw new _UnmatchedDereferenceStrategyError.default(file.uri);
|
|
40
|
+
throw new _UnmatchedDereferenceStrategyError.default(`Could not find a dereference strategy that can dereference the file "${file.uri}"`);
|
|
41
41
|
}
|
|
42
42
|
try {
|
|
43
43
|
const {
|
|
@@ -31,7 +31,7 @@ export const dereferenceApiDOM = async (element, options) => {
|
|
|
31
31
|
|
|
32
32
|
// we couldn't find any dereference strategy for this File
|
|
33
33
|
if (isEmpty(dereferenceStrategies)) {
|
|
34
|
-
throw new UnmatchedDereferenceStrategyError(file.uri);
|
|
34
|
+
throw new UnmatchedDereferenceStrategyError(`Could not find a dereference strategy that can dereference the file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
try {
|
|
37
37
|
const {
|
|
@@ -440,7 +440,7 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
440
440
|
operationElement = (0, _apidomTraverse.find)(reference.value.result, e => (0, _apidomNsOpenapi.isOperationElement)(e) && (0, _apidomDatamodel.isElement)(e.operationId) && e.operationId.equals(operationId));
|
|
441
441
|
// OperationElement not found by its operationId
|
|
442
442
|
if ((0, _ramdaAdjunct.isUndefined)(operationElement)) {
|
|
443
|
-
throw new _apidomError.ApiDOMError(`OperationElement(operationId=${operationId}) not found
|
|
443
|
+
throw new _apidomError.ApiDOMError(`OperationElement(operationId=${operationId}) not found`);
|
|
444
444
|
}
|
|
445
445
|
const linkElementCopy = (0, _apidomDatamodel.cloneShallow)(linkElement);
|
|
446
446
|
linkElementCopy.operationId?.meta.set('operation', operationElement);
|
|
@@ -434,7 +434,7 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
434
434
|
operationElement = find(reference.value.result, e => isOperationElement(e) && isElement(e.operationId) && e.operationId.equals(operationId));
|
|
435
435
|
// OperationElement not found by its operationId
|
|
436
436
|
if (isUndefined(operationElement)) {
|
|
437
|
-
throw new ApiDOMError(`OperationElement(operationId=${operationId}) not found
|
|
437
|
+
throw new ApiDOMError(`OperationElement(operationId=${operationId}) not found`);
|
|
438
438
|
}
|
|
439
439
|
const linkElementCopy = cloneShallow(linkElement);
|
|
440
440
|
linkElementCopy.operationId?.meta.set('operation', operationElement);
|
|
@@ -462,7 +462,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
462
462
|
operationElement = (0, _apidomTraverse.find)(reference.value.result, e => (0, _apidomNsOpenapi.isOperationElement)(e) && (0, _apidomDatamodel.isElement)(e.operationId) && e.operationId.equals(operationId));
|
|
463
463
|
// OperationElement not found by its operationId
|
|
464
464
|
if ((0, _ramdaAdjunct.isUndefined)(operationElement)) {
|
|
465
|
-
throw new _apidomError.ApiDOMError(`OperationElement(operationId=${operationId}) not found
|
|
465
|
+
throw new _apidomError.ApiDOMError(`OperationElement(operationId=${operationId}) not found`);
|
|
466
466
|
}
|
|
467
467
|
const linkElementCopy = (0, _apidomDatamodel.cloneShallow)(linkElement);
|
|
468
468
|
linkElementCopy.operationId?.meta.set('operation', operationElement);
|
|
@@ -456,7 +456,7 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
456
456
|
operationElement = find(reference.value.result, e => isOperationElement(e) && isElement(e.operationId) && e.operationId.equals(operationId));
|
|
457
457
|
// OperationElement not found by its operationId
|
|
458
458
|
if (isUndefined(operationElement)) {
|
|
459
|
-
throw new ApiDOMError(`OperationElement(operationId=${operationId}) not found
|
|
459
|
+
throw new ApiDOMError(`OperationElement(operationId=${operationId}) not found`);
|
|
460
460
|
}
|
|
461
461
|
const linkElementCopy = cloneShallow(linkElement);
|
|
462
462
|
linkElementCopy.operationId?.meta.set('operation', operationElement);
|
|
@@ -9,7 +9,7 @@ var _JsonSchema$anchorError = _interopRequireDefault(require("./JsonSchema$ancho
|
|
|
9
9
|
*/
|
|
10
10
|
class InvalidJsonSchema$anchorError extends _JsonSchema$anchorError.default {
|
|
11
11
|
constructor(anchor) {
|
|
12
|
-
super(`Invalid JSON Schema $anchor "${anchor}"
|
|
12
|
+
super(`Invalid JSON Schema $anchor "${anchor}"`);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
var _default = exports.default = InvalidJsonSchema$anchorError;
|
|
@@ -4,7 +4,7 @@ import JsonSchema$anchorError from "./JsonSchema$anchorError.mjs";
|
|
|
4
4
|
*/
|
|
5
5
|
class InvalidJsonSchema$anchorError extends JsonSchema$anchorError {
|
|
6
6
|
constructor(anchor) {
|
|
7
|
-
super(`Invalid JSON Schema $anchor "${anchor}"
|
|
7
|
+
super(`Invalid JSON Schema $anchor "${anchor}"`);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export default InvalidJsonSchema$anchorError;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _ParserError = _interopRequireDefault(require("./ParserError.cjs"));
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class UnmatchedParserError extends _ParserError.default {}
|
|
11
|
+
var _default = exports.default = UnmatchedParserError;
|
package/src/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
-
exports.url = exports.resolveApiDOM = exports.resolve = exports.readFile = exports.parse = exports.options = exports.mergeOptions = exports.dereferenceApiDOM = exports.dereference = exports.bundle = exports.UnmatchedResolverError = exports.UnmatchedResolveStrategyError = exports.UnmatchedDereferenceStrategyError = exports.UnmatchedBundleStrategyError = exports.ResolverError = exports.Resolver = exports.ResolveStrategy = exports.ResolveError = exports.Reference = exports.PluginError = exports.ParserError = exports.Parser = exports.ParseError = exports.MaximumResolveDepthError = exports.MaximumDereferenceDepthError = exports.MaximumBundleDepthError = exports.JsonSchemaURIError = exports.JsonSchema$anchorError = exports.InvalidJsonSchema$anchorError = exports.HTTPResolver = exports.EvaluationJsonSchemaUriError = exports.EvaluationJsonSchema$anchorError = exports.EvaluationElementIdError = exports.DereferenceStrategy = exports.DereferenceError = exports.DereferenceAncestorLineage = exports.BundleStrategy = exports.BundleError = void 0;
|
|
6
|
+
exports.url = exports.resolveApiDOM = exports.resolve = exports.readFile = exports.parse = exports.options = exports.mergeOptions = exports.dereferenceApiDOM = exports.dereference = exports.bundle = exports.UnmatchedResolverError = exports.UnmatchedResolveStrategyError = exports.UnmatchedParserError = exports.UnmatchedDereferenceStrategyError = exports.UnmatchedBundleStrategyError = exports.ResolverError = exports.Resolver = exports.ResolveStrategy = exports.ResolveError = exports.Reference = exports.PluginError = exports.ParserError = exports.Parser = exports.ParseError = exports.MaximumResolveDepthError = exports.MaximumDereferenceDepthError = exports.MaximumBundleDepthError = exports.JsonSchemaURIError = exports.JsonSchema$anchorError = exports.InvalidJsonSchema$anchorError = exports.HTTPResolver = exports.EvaluationJsonSchemaUriError = exports.EvaluationJsonSchema$anchorError = exports.EvaluationElementIdError = exports.DereferenceStrategy = exports.DereferenceError = exports.DereferenceAncestorLineage = exports.BundleStrategy = exports.BundleError = void 0;
|
|
7
7
|
var _File = _interopRequireDefault(require("./File.cjs"));
|
|
8
8
|
exports.File = _File.default;
|
|
9
9
|
var _ReferenceSet = _interopRequireDefault(require("./ReferenceSet.cjs"));
|
|
@@ -75,6 +75,8 @@ var _UnmatchedResolveStrategyError = _interopRequireDefault(require("./errors/Un
|
|
|
75
75
|
exports.UnmatchedResolveStrategyError = _UnmatchedResolveStrategyError.default;
|
|
76
76
|
var _UnmatchedResolverError = _interopRequireDefault(require("./errors/UnmatchedResolverError.cjs"));
|
|
77
77
|
exports.UnmatchedResolverError = _UnmatchedResolverError.default;
|
|
78
|
+
var _UnmatchedParserError = _interopRequireDefault(require("./errors/UnmatchedParserError.cjs"));
|
|
79
|
+
exports.UnmatchedParserError = _UnmatchedParserError.default;
|
|
78
80
|
/**
|
|
79
81
|
* @public
|
|
80
82
|
*/
|
package/src/index.mjs
CHANGED
|
@@ -41,6 +41,7 @@ export { default as ResolverError } from "./errors/ResolverError.mjs";
|
|
|
41
41
|
export { default as UnmatchedDereferenceStrategyError } from "./errors/UnmatchedDereferenceStrategyError.mjs";
|
|
42
42
|
export { default as UnmatchedResolveStrategyError } from "./errors/UnmatchedResolveStrategyError.mjs";
|
|
43
43
|
export { default as UnmatchedResolverError } from "./errors/UnmatchedResolverError.mjs";
|
|
44
|
+
export { default as UnmatchedParserError } from "./errors/UnmatchedParserError.mjs";
|
|
44
45
|
/**
|
|
45
46
|
* @public
|
|
46
47
|
*/
|
package/src/parse/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var url = _interopRequireWildcard(require("../util/url.cjs"));
|
|
|
9
9
|
var _File = _interopRequireDefault(require("../File.cjs"));
|
|
10
10
|
var plugins = _interopRequireWildcard(require("../util/plugins.cjs"));
|
|
11
11
|
var _ParseError = _interopRequireDefault(require("../errors/ParseError.cjs"));
|
|
12
|
-
var
|
|
12
|
+
var _UnmatchedParserError = _interopRequireDefault(require("../errors/UnmatchedParserError.cjs"));
|
|
13
13
|
var _util = require("../resolve/util.cjs");
|
|
14
14
|
/**
|
|
15
15
|
* Parses the given file's contents, using the configured parser plugins.
|
|
@@ -23,7 +23,7 @@ const parseFile = async (file, options) => {
|
|
|
23
23
|
|
|
24
24
|
// we couldn't find any parser for this File
|
|
25
25
|
if ((0, _ramda.isEmpty)(parsers)) {
|
|
26
|
-
throw new
|
|
26
|
+
throw new _UnmatchedParserError.default(`Could not find a parser that can parse the file "${file.uri}"`);
|
|
27
27
|
}
|
|
28
28
|
try {
|
|
29
29
|
const {
|
|
@@ -33,7 +33,7 @@ const parseFile = async (file, options) => {
|
|
|
33
33
|
|
|
34
34
|
// empty files handling
|
|
35
35
|
if (!plugin.allowEmpty && result.isEmpty) {
|
|
36
|
-
return Promise.reject(new _ParseError.default(`Error while parsing file "${file.uri}"
|
|
36
|
+
return Promise.reject(new _ParseError.default(`Error while parsing file "${file.uri}": file is empty`));
|
|
37
37
|
}
|
|
38
38
|
return result;
|
|
39
39
|
} catch (error) {
|
package/src/parse/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import * as url from "../util/url.mjs";
|
|
|
3
3
|
import File from "../File.mjs";
|
|
4
4
|
import * as plugins from "../util/plugins.mjs";
|
|
5
5
|
import ParseError from "../errors/ParseError.mjs";
|
|
6
|
-
import
|
|
6
|
+
import UnmatchedParserError from "../errors/UnmatchedParserError.mjs";
|
|
7
7
|
import { readFile } from "../resolve/util.mjs";
|
|
8
8
|
/**
|
|
9
9
|
* Parses the given file's contents, using the configured parser plugins.
|
|
@@ -17,7 +17,7 @@ const parseFile = async (file, options) => {
|
|
|
17
17
|
|
|
18
18
|
// we couldn't find any parser for this File
|
|
19
19
|
if (isEmpty(parsers)) {
|
|
20
|
-
throw new
|
|
20
|
+
throw new UnmatchedParserError(`Could not find a parser that can parse the file "${file.uri}"`);
|
|
21
21
|
}
|
|
22
22
|
try {
|
|
23
23
|
const {
|
|
@@ -27,7 +27,7 @@ const parseFile = async (file, options) => {
|
|
|
27
27
|
|
|
28
28
|
// empty files handling
|
|
29
29
|
if (!plugin.allowEmpty && result.isEmpty) {
|
|
30
|
-
return Promise.reject(new ParseError(`Error while parsing file "${file.uri}"
|
|
30
|
+
return Promise.reject(new ParseError(`Error while parsing file "${file.uri}": file is empty`));
|
|
31
31
|
}
|
|
32
32
|
return result;
|
|
33
33
|
} catch (error) {
|
package/src/resolve/index.cjs
CHANGED
|
@@ -35,9 +35,9 @@ const resolveApiDOM = async (element, options) => {
|
|
|
35
35
|
});
|
|
36
36
|
const resolveStrategies = await plugins.filter('canResolve', [file, options], options.resolve.strategies);
|
|
37
37
|
|
|
38
|
-
// we couldn't find any
|
|
38
|
+
// we couldn't find any resolve strategy for this File
|
|
39
39
|
if ((0, _ramda.isEmpty)(resolveStrategies)) {
|
|
40
|
-
throw new _UnmatchedResolveStrategyError.default(file.uri);
|
|
40
|
+
throw new _UnmatchedResolveStrategyError.default(`Could not find a resolve strategy that can resolve the file "${file.uri}"`);
|
|
41
41
|
}
|
|
42
42
|
try {
|
|
43
43
|
const {
|
package/src/resolve/index.mjs
CHANGED
|
@@ -29,9 +29,9 @@ export const resolveApiDOM = async (element, options) => {
|
|
|
29
29
|
});
|
|
30
30
|
const resolveStrategies = await plugins.filter('canResolve', [file, options], options.resolve.strategies);
|
|
31
31
|
|
|
32
|
-
// we couldn't find any
|
|
32
|
+
// we couldn't find any resolve strategy for this File
|
|
33
33
|
if (isEmpty(resolveStrategies)) {
|
|
34
|
-
throw new UnmatchedResolveStrategyError(file.uri);
|
|
34
|
+
throw new UnmatchedResolveStrategyError(`Could not find a resolve strategy that can resolve the file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
try {
|
|
37
37
|
const {
|
|
@@ -31,7 +31,7 @@ class ApiDOMResolveStrategy extends _ResolveStrategy.default {
|
|
|
31
31
|
async resolve(file, options) {
|
|
32
32
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'apidom');
|
|
33
33
|
if (dereferenceStrategy === undefined) {
|
|
34
|
-
throw new _UnmatchedDereferenceStrategyError.default(
|
|
34
|
+
throw new _UnmatchedDereferenceStrategyError.default(`"apidom" resolve strategy requires "apidom" dereference strategy to be configured for file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
const refSet = new _ReferenceSet.default();
|
|
37
37
|
const mergedOptions = (0, _util.merge)(options, {
|
|
@@ -25,7 +25,7 @@ class ApiDOMResolveStrategy extends ResolveStrategy {
|
|
|
25
25
|
async resolve(file, options) {
|
|
26
26
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'apidom');
|
|
27
27
|
if (dereferenceStrategy === undefined) {
|
|
28
|
-
throw new UnmatchedDereferenceStrategyError(
|
|
28
|
+
throw new UnmatchedDereferenceStrategyError(`"apidom" resolve strategy requires "apidom" dereference strategy to be configured for file "${file.uri}"`);
|
|
29
29
|
}
|
|
30
30
|
const refSet = new ReferenceSet();
|
|
31
31
|
const mergedOptions = mergeOptions(options, {
|
|
@@ -31,7 +31,7 @@ class AsyncAPI2ResolveStrategy extends _ResolveStrategy.default {
|
|
|
31
31
|
async resolve(file, options) {
|
|
32
32
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'asyncapi-2');
|
|
33
33
|
if (dereferenceStrategy === undefined) {
|
|
34
|
-
throw new _UnmatchedDereferenceStrategyError.default(
|
|
34
|
+
throw new _UnmatchedDereferenceStrategyError.default(`"asyncapi-2" resolve strategy requires "asyncapi-2" dereference strategy to be configured for file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
const refSet = new _ReferenceSet.default();
|
|
37
37
|
const mergedOptions = (0, _util.merge)(options, {
|
|
@@ -25,7 +25,7 @@ class AsyncAPI2ResolveStrategy extends ResolveStrategy {
|
|
|
25
25
|
async resolve(file, options) {
|
|
26
26
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'asyncapi-2');
|
|
27
27
|
if (dereferenceStrategy === undefined) {
|
|
28
|
-
throw new UnmatchedDereferenceStrategyError(
|
|
28
|
+
throw new UnmatchedDereferenceStrategyError(`"asyncapi-2" resolve strategy requires "asyncapi-2" dereference strategy to be configured for file "${file.uri}"`);
|
|
29
29
|
}
|
|
30
30
|
const refSet = new ReferenceSet();
|
|
31
31
|
const mergedOptions = mergeOptions(options, {
|
|
@@ -31,7 +31,7 @@ class OpenAPI2ResolveStrategy extends _ResolveStrategy.default {
|
|
|
31
31
|
async resolve(file, options) {
|
|
32
32
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'openapi-2');
|
|
33
33
|
if (dereferenceStrategy === undefined) {
|
|
34
|
-
throw new _UnmatchedDereferenceStrategyError.default(
|
|
34
|
+
throw new _UnmatchedDereferenceStrategyError.default(`"openapi-2" resolve strategy requires "openapi-2" dereference strategy to be configured for file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
const refSet = new _ReferenceSet.default();
|
|
37
37
|
const mergedOptions = (0, _util.merge)(options, {
|
|
@@ -25,7 +25,7 @@ class OpenAPI2ResolveStrategy extends ResolveStrategy {
|
|
|
25
25
|
async resolve(file, options) {
|
|
26
26
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'openapi-2');
|
|
27
27
|
if (dereferenceStrategy === undefined) {
|
|
28
|
-
throw new UnmatchedDereferenceStrategyError(
|
|
28
|
+
throw new UnmatchedDereferenceStrategyError(`"openapi-2" resolve strategy requires "openapi-2" dereference strategy to be configured for file "${file.uri}"`);
|
|
29
29
|
}
|
|
30
30
|
const refSet = new ReferenceSet();
|
|
31
31
|
const mergedOptions = mergeOptions(options, {
|
|
@@ -31,7 +31,7 @@ class OpenAPI3_0ResolveStrategy extends _ResolveStrategy.default {
|
|
|
31
31
|
async resolve(file, options) {
|
|
32
32
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'openapi-3-0');
|
|
33
33
|
if (dereferenceStrategy === undefined) {
|
|
34
|
-
throw new _UnmatchedDereferenceStrategyError.default(
|
|
34
|
+
throw new _UnmatchedDereferenceStrategyError.default(`"openapi-3-0" resolve strategy requires "openapi-3-0" dereference strategy to be configured for file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
const refSet = new _ReferenceSet.default();
|
|
37
37
|
const mergedOptions = (0, _util.merge)(options, {
|
|
@@ -25,7 +25,7 @@ class OpenAPI3_0ResolveStrategy extends ResolveStrategy {
|
|
|
25
25
|
async resolve(file, options) {
|
|
26
26
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'openapi-3-0');
|
|
27
27
|
if (dereferenceStrategy === undefined) {
|
|
28
|
-
throw new UnmatchedDereferenceStrategyError(
|
|
28
|
+
throw new UnmatchedDereferenceStrategyError(`"openapi-3-0" resolve strategy requires "openapi-3-0" dereference strategy to be configured for file "${file.uri}"`);
|
|
29
29
|
}
|
|
30
30
|
const refSet = new ReferenceSet();
|
|
31
31
|
const mergedOptions = mergeOptions(options, {
|
|
@@ -31,7 +31,7 @@ class OpenAPI3_1ResolveStrategy extends _ResolveStrategy.default {
|
|
|
31
31
|
async resolve(file, options) {
|
|
32
32
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'openapi-3-1');
|
|
33
33
|
if (dereferenceStrategy === undefined) {
|
|
34
|
-
throw new _UnmatchedDereferenceStrategyError.default(
|
|
34
|
+
throw new _UnmatchedDereferenceStrategyError.default(`"openapi-3-1" resolve strategy requires "openapi-3-1" dereference strategy to be configured for file "${file.uri}"`);
|
|
35
35
|
}
|
|
36
36
|
const refSet = new _ReferenceSet.default();
|
|
37
37
|
const mergedOptions = (0, _util.merge)(options, {
|
|
@@ -25,7 +25,7 @@ class OpenAPI3_1ResolveStrategy extends ResolveStrategy {
|
|
|
25
25
|
async resolve(file, options) {
|
|
26
26
|
const dereferenceStrategy = options.dereference.strategies.find(strategy => strategy.name === 'openapi-3-1');
|
|
27
27
|
if (dereferenceStrategy === undefined) {
|
|
28
|
-
throw new UnmatchedDereferenceStrategyError(
|
|
28
|
+
throw new UnmatchedDereferenceStrategyError(`"openapi-3-1" resolve strategy requires "openapi-3-1" dereference strategy to be configured for file "${file.uri}"`);
|
|
29
29
|
}
|
|
30
30
|
const refSet = new ReferenceSet();
|
|
31
31
|
const mergedOptions = mergeOptions(options, {
|
package/src/resolve/util.cjs
CHANGED
|
@@ -21,7 +21,7 @@ const readFile = async (file, options) => {
|
|
|
21
21
|
|
|
22
22
|
// we couldn't find any resolver for this File
|
|
23
23
|
if ((0, _ramda.isEmpty)(resolvers)) {
|
|
24
|
-
throw new _UnmatchedResolverError.default(file.uri);
|
|
24
|
+
throw new _UnmatchedResolverError.default(`Could not find a resolver that can read the file "${file.uri}"`);
|
|
25
25
|
}
|
|
26
26
|
try {
|
|
27
27
|
const {
|
package/src/resolve/util.mjs
CHANGED
|
@@ -15,7 +15,7 @@ export const readFile = async (file, options) => {
|
|
|
15
15
|
|
|
16
16
|
// we couldn't find any resolver for this File
|
|
17
17
|
if (isEmpty(resolvers)) {
|
|
18
|
-
throw new UnmatchedResolverError(file.uri);
|
|
18
|
+
throw new UnmatchedResolverError(`Could not find a resolver that can read the file "${file.uri}"`);
|
|
19
19
|
}
|
|
20
20
|
try {
|
|
21
21
|
const {
|
|
@@ -533,6 +533,12 @@ export declare class UnmatchedBundleStrategyError extends BundleError {
|
|
|
533
533
|
export declare class UnmatchedDereferenceStrategyError extends DereferenceError {
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
+
/**
|
|
537
|
+
* @public
|
|
538
|
+
*/
|
|
539
|
+
export declare class UnmatchedParserError extends ParserError {
|
|
540
|
+
}
|
|
541
|
+
|
|
536
542
|
/**
|
|
537
543
|
* @public
|
|
538
544
|
*/
|
package/types/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export { default as ResolverError } from './errors/ResolverError.ts';
|
|
|
45
45
|
export { default as UnmatchedDereferenceStrategyError } from './errors/UnmatchedDereferenceStrategyError.ts';
|
|
46
46
|
export { default as UnmatchedResolveStrategyError } from './errors/UnmatchedResolveStrategyError.ts';
|
|
47
47
|
export { default as UnmatchedResolverError } from './errors/UnmatchedResolverError.ts';
|
|
48
|
+
export { default as UnmatchedParserError } from './errors/UnmatchedParserError.ts';
|
|
48
49
|
/**
|
|
49
50
|
* @public
|
|
50
51
|
*/
|