@jentic/arazzo-resolver 1.0.0-alpha.23 → 1.0.0-alpha.24
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
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.24](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2026-03-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @jentic/arazzo-resolver
|
|
9
|
+
|
|
6
10
|
# [1.0.0-alpha.23](https://github.com/jentic/jentic-arazzo-tools/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2026-03-11)
|
|
7
11
|
|
|
8
12
|
### Features
|
|
@@ -38344,7 +38344,8 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
38344
38344
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(linkElement.operationId)) {
|
|
38345
38345
|
const operationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(linkElement.operationId);
|
|
38346
38346
|
const reference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.unsanitize(this.reference.uri));
|
|
38347
|
-
|
|
38347
|
+
const operationPath = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.find)(reference.value.result, path => (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__.isOperationElement)(path.node) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(path.node.operationId) && path.node.operationId.equals(operationId));
|
|
38348
|
+
operationElement = operationPath?.node;
|
|
38348
38349
|
// OperationElement not found by its operationId
|
|
38349
38350
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(operationElement)) {
|
|
38350
38351
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_7__["default"](`OperationElement(operationId=${operationId}) not found`, {
|
|
@@ -38601,15 +38602,13 @@ const parse = anchor => {
|
|
|
38601
38602
|
*/
|
|
38602
38603
|
const evaluate = (anchor, element) => {
|
|
38603
38604
|
const token = parse(anchor);
|
|
38604
|
-
|
|
38605
|
+
const resultPath = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_3__.find)(element,
|
|
38605
38606
|
// @ts-ignore
|
|
38606
|
-
|
|
38607
|
-
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(
|
|
38607
|
+
path => (0,_speclynx_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTED_MODULE_4__.isJSONSchemaElement)(path.node) && (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(path.node.$anchor) === token);
|
|
38608
|
+
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_0__["default"])(resultPath)) {
|
|
38608
38609
|
throw new _errors_EvaluationJsonSchema$anchorError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](`Evaluation failed on token: "${token}"`);
|
|
38609
38610
|
}
|
|
38610
|
-
|
|
38611
|
-
// @ts-ignore
|
|
38612
|
-
return result;
|
|
38611
|
+
return resultPath.node;
|
|
38613
38612
|
};
|
|
38614
38613
|
|
|
38615
38614
|
|
|
@@ -38653,12 +38652,12 @@ const evaluate = (uri, element) => {
|
|
|
38653
38652
|
cache
|
|
38654
38653
|
} = evaluate;
|
|
38655
38654
|
const uriStrippedHash = _util_url_mjs__WEBPACK_IMPORTED_MODULE_5__.stripHash(uri);
|
|
38656
|
-
const isJSONSchemaElementWith$id =
|
|
38655
|
+
const isJSONSchemaElementWith$id = path => (0,_speclynx_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTED_MODULE_2__.isJSONSchemaElement)(path.node) && typeof path.node.$id !== 'undefined';
|
|
38657
38656
|
|
|
38658
38657
|
// warm the cache
|
|
38659
38658
|
if (!cache.has(element)) {
|
|
38660
|
-
const
|
|
38661
|
-
cache.set(element,
|
|
38659
|
+
const schemaObjectPaths = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__.filter)(element, isJSONSchemaElementWith$id);
|
|
38660
|
+
cache.set(element, schemaObjectPaths.map(path => path.node));
|
|
38662
38661
|
}
|
|
38663
38662
|
|
|
38664
38663
|
// search for the matching schema
|
|
@@ -39356,7 +39355,8 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
39356
39355
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isStringElement)(linkElement.operationId)) {
|
|
39357
39356
|
const operationId = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(linkElement.operationId);
|
|
39358
39357
|
const reference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_23__.unsanitize(this.reference.uri));
|
|
39359
|
-
|
|
39358
|
+
const operationPath = (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.find)(reference.value.result, path => (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_16__.isOperationElement)(path.node) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isElement)(path.node.operationId) && path.node.operationId.equals(operationId));
|
|
39359
|
+
operationElement = operationPath?.node;
|
|
39360
39360
|
// OperationElement not found by its operationId
|
|
39361
39361
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(operationElement)) {
|
|
39362
39362
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_9__["default"](`OperationElement(operationId=${operationId}) not found`, {
|
|
@@ -42636,7 +42636,9 @@ class Path {
|
|
|
42636
42636
|
*
|
|
42637
42637
|
* @example
|
|
42638
42638
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
42639
|
+
* ```
|
|
42639
42640
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
42641
|
+
* ```
|
|
42640
42642
|
*/
|
|
42641
42643
|
getPathKeys() {
|
|
42642
42644
|
const keys = [];
|
|
@@ -42671,18 +42673,22 @@ class Path {
|
|
|
42671
42673
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
42672
42674
|
*
|
|
42673
42675
|
* @example
|
|
42676
|
+
* ```
|
|
42674
42677
|
* // JSON Pointer examples:
|
|
42675
42678
|
* path.formatPath(); // "" (root)
|
|
42676
42679
|
* path.formatPath(); // "/info"
|
|
42677
42680
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
42678
42681
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
42682
|
+
* ```
|
|
42679
42683
|
*
|
|
42680
42684
|
* @example
|
|
42685
|
+
* ```
|
|
42681
42686
|
* // JSONPath examples:
|
|
42682
42687
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
42683
42688
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
42684
42689
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
42685
42690
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
42691
|
+
* ```
|
|
42686
42692
|
*/
|
|
42687
42693
|
formatPath(pathFormat = 'jsonpointer') {
|
|
42688
42694
|
const parts = this.getPathKeys();
|
|
@@ -42892,15 +42898,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42892
42898
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66061);
|
|
42893
42899
|
|
|
42894
42900
|
/**
|
|
42895
|
-
* Finds all elements
|
|
42901
|
+
* Finds all paths whose elements match the predicate.
|
|
42896
42902
|
* @public
|
|
42897
42903
|
*/
|
|
42898
42904
|
const filter = (element, predicate) => {
|
|
42899
42905
|
const result = [];
|
|
42900
42906
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
42901
42907
|
enter(path) {
|
|
42902
|
-
if (predicate(path
|
|
42903
|
-
result.push(path
|
|
42908
|
+
if (predicate(path)) {
|
|
42909
|
+
result.push(path);
|
|
42904
42910
|
}
|
|
42905
42911
|
}
|
|
42906
42912
|
});
|
|
@@ -42926,7 +42932,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42926
42932
|
* @public
|
|
42927
42933
|
*/
|
|
42928
42934
|
/**
|
|
42929
|
-
* Finds the most inner node at the given offset.
|
|
42935
|
+
* Finds the path of the most inner node at the given offset.
|
|
42930
42936
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
42931
42937
|
* @public
|
|
42932
42938
|
*/
|
|
@@ -42951,7 +42957,7 @@ const findAtOffset = (element, options) => {
|
|
|
42951
42957
|
const endOffset = node.endOffset;
|
|
42952
42958
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
42953
42959
|
if (isWithinOffsetRange) {
|
|
42954
|
-
result.push(
|
|
42960
|
+
result.push(path);
|
|
42955
42961
|
return; // push to stack and dive in
|
|
42956
42962
|
}
|
|
42957
42963
|
path.skip(); // skip entire sub-tree
|
|
@@ -42974,15 +42980,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42974
42980
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66061);
|
|
42975
42981
|
|
|
42976
42982
|
/**
|
|
42977
|
-
*
|
|
42983
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
42978
42984
|
* @public
|
|
42979
42985
|
*/
|
|
42980
42986
|
const find = (element, predicate) => {
|
|
42981
42987
|
let result;
|
|
42982
42988
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
42983
42989
|
enter(path) {
|
|
42984
|
-
if (predicate(path
|
|
42985
|
-
result = path
|
|
42990
|
+
if (predicate(path)) {
|
|
42991
|
+
result = path;
|
|
42986
42992
|
path.stop();
|
|
42987
42993
|
}
|
|
42988
42994
|
}
|
|
@@ -43001,9 +43007,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43001
43007
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
43002
43008
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
43003
43009
|
/* harmony export */ });
|
|
43004
|
-
/* harmony import */ var
|
|
43005
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66061);
|
|
43006
|
-
|
|
43010
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66061);
|
|
43007
43011
|
|
|
43008
43012
|
/**
|
|
43009
43013
|
* @public
|
|
@@ -43012,7 +43016,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43012
43016
|
* @public
|
|
43013
43017
|
*/
|
|
43014
43018
|
/**
|
|
43015
|
-
* Executes the callback on this element and all
|
|
43019
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
43016
43020
|
* @public
|
|
43017
43021
|
*/
|
|
43018
43022
|
const forEach = (element, options) => {
|
|
@@ -43020,15 +43024,15 @@ const forEach = (element, options) => {
|
|
|
43020
43024
|
let predicate;
|
|
43021
43025
|
if (typeof options === 'function') {
|
|
43022
43026
|
callback = options;
|
|
43023
|
-
predicate =
|
|
43027
|
+
predicate = () => true;
|
|
43024
43028
|
} else {
|
|
43025
43029
|
callback = options.callback ?? (() => {});
|
|
43026
|
-
predicate = options.predicate ??
|
|
43030
|
+
predicate = options.predicate ?? (() => true);
|
|
43027
43031
|
}
|
|
43028
|
-
(0,
|
|
43032
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
43029
43033
|
enter(path) {
|
|
43030
|
-
if (predicate(path
|
|
43031
|
-
callback(path
|
|
43034
|
+
if (predicate(path)) {
|
|
43035
|
+
callback(path);
|
|
43032
43036
|
}
|
|
43033
43037
|
}
|
|
43034
43038
|
});
|
|
@@ -43077,11 +43081,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43077
43081
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5800);
|
|
43078
43082
|
|
|
43079
43083
|
/**
|
|
43080
|
-
* Complement of filter. Finds all elements NOT
|
|
43084
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
43081
43085
|
* @public
|
|
43082
43086
|
*/
|
|
43083
43087
|
const reject = (element, predicate) => {
|
|
43084
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
43088
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
43085
43089
|
};
|
|
43086
43090
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
43087
43091
|
|
|
@@ -43098,7 +43102,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43098
43102
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66919);
|
|
43099
43103
|
|
|
43100
43104
|
/**
|
|
43101
|
-
* Tests whether at least one element passes the predicate.
|
|
43105
|
+
* Tests whether at least one path's element passes the predicate.
|
|
43102
43106
|
* @public
|
|
43103
43107
|
*/
|
|
43104
43108
|
const some = (element, predicate) => {
|