@speclynx/apidom-reference 3.2.0 → 3.2.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 +6 -0
- package/dist/apidom-reference.browser.js +122 -91
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +25 -25
- package/src/dereference/strategies/apidom/visitor.cjs +14 -7
- package/src/dereference/strategies/apidom/visitor.mjs +14 -7
- package/src/dereference/strategies/arazzo-1/visitor.cjs +14 -8
- package/src/dereference/strategies/arazzo-1/visitor.mjs +14 -8
- package/src/dereference/strategies/asyncapi-2/visitor.cjs +14 -8
- package/src/dereference/strategies/asyncapi-2/visitor.mjs +14 -8
- package/src/dereference/strategies/openapi-2/visitor.cjs +14 -8
- package/src/dereference/strategies/openapi-2/visitor.mjs +14 -8
- package/src/dereference/strategies/openapi-3-0/visitor.cjs +14 -8
- package/src/dereference/strategies/openapi-3-0/visitor.mjs +14 -8
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +14 -8
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +14 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
## [3.2.1](https://github.com/speclynx/apidom/compare/v3.2.0...v3.2.1) (2026-03-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix issues preventing integrating with Language Service ([#143](https://github.com/speclynx/apidom/issues/143)) ([26480d7](https://github.com/speclynx/apidom/commit/26480d7a495fa57da8b39120a73f64ab2d9d61bf))
|
|
11
|
+
|
|
6
12
|
# [3.2.0](https://github.com/speclynx/apidom/compare/v3.1.0...v3.2.0) (2026-03-08)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -750,15 +750,22 @@ class ApiDOMDereferenceVisitor {
|
|
|
750
750
|
const isEntryDocument = _util_url_ts__WEBPACK_IMPORTED_MODULE_12__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
|
|
751
751
|
const uri = this.reference.uri;
|
|
752
752
|
const type = referencingElement.element;
|
|
753
|
+
// find element location by identity in the document tree.
|
|
754
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
755
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
756
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
753
757
|
let location;
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
p.
|
|
758
|
+
const root = this.reference.value.result;
|
|
759
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(root)) {
|
|
760
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(root, {
|
|
761
|
+
enter(p) {
|
|
762
|
+
if (p.node === referencingElement) {
|
|
763
|
+
location = p.formatPath();
|
|
764
|
+
p.stop();
|
|
765
|
+
}
|
|
759
766
|
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
767
|
+
});
|
|
768
|
+
}
|
|
762
769
|
location ??= visitorPath.formatPath();
|
|
763
770
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement);
|
|
764
771
|
const hop = {
|
|
@@ -1519,16 +1526,22 @@ class Arazzo1DereferenceVisitor {
|
|
|
1519
1526
|
const type = referencingElement.element;
|
|
1520
1527
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement);
|
|
1521
1528
|
|
|
1522
|
-
// find element location
|
|
1529
|
+
// find element location by identity in the document tree.
|
|
1530
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
1531
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
1532
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
1523
1533
|
let location;
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
p.
|
|
1534
|
+
const root = this.reference.value.result;
|
|
1535
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(root)) {
|
|
1536
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(root, {
|
|
1537
|
+
enter(p) {
|
|
1538
|
+
if (p.node === referencingElement) {
|
|
1539
|
+
location = p.formatPath();
|
|
1540
|
+
p.stop();
|
|
1541
|
+
}
|
|
1529
1542
|
}
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1532
1545
|
location ??= visitorPath.formatPath();
|
|
1533
1546
|
const hop = {
|
|
1534
1547
|
uri,
|
|
@@ -2153,16 +2166,22 @@ class AsyncAPI2DereferenceVisitor {
|
|
|
2153
2166
|
const type = referencingElement.element;
|
|
2154
2167
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement);
|
|
2155
2168
|
|
|
2156
|
-
// find element location
|
|
2169
|
+
// find element location by identity in the document tree.
|
|
2170
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
2171
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
2172
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
2157
2173
|
let location;
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
p.
|
|
2174
|
+
const root = this.reference.value.result;
|
|
2175
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(root)) {
|
|
2176
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__.traverse)(root, {
|
|
2177
|
+
enter: p => {
|
|
2178
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
2179
|
+
location = p.formatPath();
|
|
2180
|
+
p.stop();
|
|
2181
|
+
}
|
|
2163
2182
|
}
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2183
|
+
});
|
|
2184
|
+
}
|
|
2166
2185
|
location ??= visitorPath.formatPath();
|
|
2167
2186
|
const hop = {
|
|
2168
2187
|
uri,
|
|
@@ -2789,16 +2808,22 @@ class OpenAPI2DereferenceVisitor {
|
|
|
2789
2808
|
const type = referencingElement.element;
|
|
2790
2809
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement);
|
|
2791
2810
|
|
|
2792
|
-
// find element location
|
|
2811
|
+
// find element location by identity in the document tree.
|
|
2812
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
2813
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
2814
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
2793
2815
|
let location;
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
p.
|
|
2816
|
+
const root = this.reference.value.result;
|
|
2817
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(root)) {
|
|
2818
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__.traverse)(root, {
|
|
2819
|
+
enter: p => {
|
|
2820
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
2821
|
+
location = p.formatPath();
|
|
2822
|
+
p.stop();
|
|
2823
|
+
}
|
|
2799
2824
|
}
|
|
2800
|
-
}
|
|
2801
|
-
}
|
|
2825
|
+
});
|
|
2826
|
+
}
|
|
2802
2827
|
location ??= visitorPath.formatPath();
|
|
2803
2828
|
const hop = {
|
|
2804
2829
|
uri,
|
|
@@ -3552,16 +3577,22 @@ class OpenAPI3_0DereferenceVisitor {
|
|
|
3552
3577
|
const type = referencingElement.element;
|
|
3553
3578
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement);
|
|
3554
3579
|
|
|
3555
|
-
// find element location
|
|
3580
|
+
// find element location by identity in the document tree.
|
|
3581
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
3582
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
3583
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
3556
3584
|
let location;
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
p.
|
|
3585
|
+
const root = this.reference.value.result;
|
|
3586
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(root)) {
|
|
3587
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverse)(root, {
|
|
3588
|
+
enter: p => {
|
|
3589
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
3590
|
+
location = p.formatPath();
|
|
3591
|
+
p.stop();
|
|
3592
|
+
}
|
|
3562
3593
|
}
|
|
3563
|
-
}
|
|
3564
|
-
}
|
|
3594
|
+
});
|
|
3595
|
+
}
|
|
3565
3596
|
location ??= visitorPath.formatPath();
|
|
3566
3597
|
const hop = {
|
|
3567
3598
|
uri,
|
|
@@ -4552,16 +4583,22 @@ class OpenAPI3_1DereferenceVisitor {
|
|
|
4552
4583
|
const type = referencingElement.element;
|
|
4553
4584
|
const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(referencingElement);
|
|
4554
4585
|
|
|
4555
|
-
// find element location
|
|
4586
|
+
// find element location by identity in the document tree.
|
|
4587
|
+
// guarded: this.reference.value may not be a ParseResultElement or may lack a result.
|
|
4588
|
+
// falls back to visitorPath which may produce an incomplete path when
|
|
4589
|
+
// dereferenceApiDOM is called with a fragment (cloneShallow creates a new root identity).
|
|
4556
4590
|
let location;
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
p.
|
|
4591
|
+
const root = this.reference.value.result;
|
|
4592
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.isElement)(root)) {
|
|
4593
|
+
(0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.traverse)(root, {
|
|
4594
|
+
enter: p => {
|
|
4595
|
+
if (p.node === referencingElement || this.refractCache.get(p.node) === referencingElement) {
|
|
4596
|
+
location = p.formatPath();
|
|
4597
|
+
p.stop();
|
|
4598
|
+
}
|
|
4562
4599
|
}
|
|
4563
|
-
}
|
|
4564
|
-
}
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4565
4602
|
location ??= visitorPath.formatPath();
|
|
4566
4603
|
const hop = {
|
|
4567
4604
|
uri,
|
|
@@ -79738,11 +79775,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79738
79775
|
/* harmony export */ });
|
|
79739
79776
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
79740
79777
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
79741
|
-
/* harmony import */ var
|
|
79742
|
-
/* harmony import */ var
|
|
79743
|
-
/* harmony import */ var
|
|
79744
|
-
/* harmony import */ var
|
|
79745
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(75107);
|
|
79778
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
79779
|
+
/* harmony import */ var _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(83419);
|
|
79780
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
79781
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75107);
|
|
79746
79782
|
|
|
79747
79783
|
|
|
79748
79784
|
|
|
@@ -79752,23 +79788,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79752
79788
|
/**
|
|
79753
79789
|
* @public
|
|
79754
79790
|
*/
|
|
79755
|
-
class PathItemVisitor extends
|
|
79791
|
+
class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
79756
79792
|
constructor(options) {
|
|
79757
79793
|
super(options);
|
|
79758
|
-
this.element = new
|
|
79794
|
+
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
79759
79795
|
this.consumeSafe = true;
|
|
79760
79796
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
79761
79797
|
}
|
|
79762
79798
|
ObjectElement(path) {
|
|
79763
|
-
|
|
79799
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
79764
79800
|
|
|
79765
79801
|
// decorate Operation elements with HTTP method
|
|
79766
|
-
this.element.filter(
|
|
79802
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isOperationElement)
|
|
79767
79803
|
// @ts-ignore
|
|
79768
79804
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
79769
|
-
const
|
|
79770
|
-
|
|
79771
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
79805
|
+
const httpMethod = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(httpMethodElementCI).toUpperCase();
|
|
79806
|
+
operationElement.meta.set('http-method', httpMethod);
|
|
79772
79807
|
});
|
|
79773
79808
|
|
|
79774
79809
|
// mark this PathItemElement with reference metadata
|
|
@@ -79791,7 +79826,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
79791
79826
|
/* harmony export */ });
|
|
79792
79827
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53679);
|
|
79793
79828
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29498);
|
|
79794
|
-
/* harmony import */ var
|
|
79829
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
79795
79830
|
/* harmony import */ var _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38253);
|
|
79796
79831
|
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
79797
79832
|
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75107);
|
|
@@ -79822,7 +79857,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
79822
79857
|
.forEach((pathItemElement, key) => {
|
|
79823
79858
|
key.classes.push('openapi-path-template');
|
|
79824
79859
|
key.classes.push('path-template');
|
|
79825
|
-
pathItemElement.meta.set('path', (0,
|
|
79860
|
+
pathItemElement.meta.set('path', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key));
|
|
79826
79861
|
});
|
|
79827
79862
|
}
|
|
79828
79863
|
}
|
|
@@ -80007,13 +80042,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80007
80042
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
80008
80043
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
80009
80044
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32343);
|
|
80010
|
-
/* harmony import */ var
|
|
80011
|
-
/* harmony import */ var
|
|
80012
|
-
/* harmony import */ var
|
|
80013
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
80014
|
-
/* harmony import */ var
|
|
80015
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75107);
|
|
80016
|
-
|
|
80045
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44673);
|
|
80046
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31297);
|
|
80047
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72880);
|
|
80048
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26365);
|
|
80049
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75107);
|
|
80017
80050
|
|
|
80018
80051
|
|
|
80019
80052
|
|
|
@@ -80023,32 +80056,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
80023
80056
|
/**
|
|
80024
80057
|
* @public
|
|
80025
80058
|
*/
|
|
80026
|
-
class ResponsesVisitor extends
|
|
80059
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.BaseMixedFieldsVisitor {
|
|
80027
80060
|
constructor(options) {
|
|
80028
80061
|
super(options);
|
|
80029
|
-
this.element = new
|
|
80062
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
80030
80063
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
80031
80064
|
this.canSupportSpecificationExtensions = true;
|
|
80032
80065
|
this.specPathPatternedFields = element => {
|
|
80033
|
-
return (0,
|
|
80066
|
+
return (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
80034
80067
|
};
|
|
80035
80068
|
// @ts-ignore
|
|
80036
80069
|
this.fieldPatternPredicate = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`));
|
|
80037
80070
|
}
|
|
80038
80071
|
ObjectElement(path) {
|
|
80039
|
-
|
|
80072
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_7__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
80040
80073
|
|
|
80041
80074
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
80042
80075
|
// @ts-ignore
|
|
80043
|
-
this.element.filter(
|
|
80076
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__.isReferenceElement).forEach(referenceElement => {
|
|
80044
80077
|
referenceElement.meta.set('referenced-element', 'response');
|
|
80045
80078
|
});
|
|
80046
80079
|
|
|
80047
80080
|
// decorate every ResponseElement with metadata about their status code
|
|
80048
80081
|
// @ts-ignore
|
|
80049
|
-
this.element.filter(
|
|
80050
|
-
const httpStatusCode = (0,
|
|
80051
|
-
if (!this.fieldPatternPredicate(
|
|
80082
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__.isResponseElement).forEach((value, key) => {
|
|
80083
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
80084
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
80052
80085
|
value.meta.set('http-status-code', httpStatusCode);
|
|
80053
80086
|
});
|
|
80054
80087
|
}
|
|
@@ -87837,13 +87870,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
87837
87870
|
/* harmony export */ });
|
|
87838
87871
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
87839
87872
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
87840
|
-
/* harmony import */ var
|
|
87841
|
-
/* harmony import */ var
|
|
87842
|
-
/* harmony import */ var
|
|
87843
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
87844
|
-
/* harmony import */ var
|
|
87845
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74367);
|
|
87846
|
-
|
|
87873
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
87874
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71767);
|
|
87875
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21314);
|
|
87876
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32131);
|
|
87877
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74367);
|
|
87847
87878
|
|
|
87848
87879
|
|
|
87849
87880
|
|
|
@@ -87856,29 +87887,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
87856
87887
|
/**
|
|
87857
87888
|
* @public
|
|
87858
87889
|
*/
|
|
87859
|
-
class ResponsesVisitor extends
|
|
87890
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor {
|
|
87860
87891
|
constructor(options) {
|
|
87861
87892
|
super(options);
|
|
87862
|
-
this.element = new
|
|
87893
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
87863
87894
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
87864
87895
|
this.canSupportSpecificationExtensions = true;
|
|
87865
|
-
this.specPathPatternedFields = element => (0,
|
|
87896
|
+
this.specPathPatternedFields = element => (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
87866
87897
|
this.fieldPatternPredicate = value => new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`).test(String(value));
|
|
87867
87898
|
}
|
|
87868
87899
|
ObjectElement(path) {
|
|
87869
|
-
|
|
87900
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
87870
87901
|
|
|
87871
87902
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
87872
87903
|
// @ts-ignore
|
|
87873
|
-
this.element.filter(
|
|
87904
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceElement).forEach(referenceElement => {
|
|
87874
87905
|
referenceElement.meta.set('referenced-element', 'response');
|
|
87875
87906
|
});
|
|
87876
87907
|
|
|
87877
87908
|
// decorate every ResponseElement with metadata about their status code
|
|
87878
87909
|
// @ts-ignore
|
|
87879
|
-
this.element.filter(
|
|
87880
|
-
const httpStatusCode = (0,
|
|
87881
|
-
if (!this.fieldPatternPredicate(
|
|
87910
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isResponseElement).forEach((value, key) => {
|
|
87911
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
87912
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
87882
87913
|
value.meta.set('http-status-code', httpStatusCode);
|
|
87883
87914
|
});
|
|
87884
87915
|
}
|