@speclynx/apidom-parser-adapter-openapi-json-3-0 3.2.0 → 4.0.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.
- package/CHANGELOG.md +8 -0
- package/dist/apidom-parser-adapter-openapi-json-3-0.browser.js +37 -35
- package/dist/apidom-parser-adapter-openapi-json-3-0.browser.min.js +1 -1
- package/package.json +6 -6
- package/src/adapter.cjs +0 -53
- package/src/adapter.mjs +0 -45
- package/src/media-types.cjs +0 -10
- package/src/media-types.mjs +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
# [4.0.0](https://github.com/speclynx/apidom/compare/v3.2.1...v4.0.0) (2026-03-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-json-3-0
|
|
9
|
+
|
|
10
|
+
## [3.2.1](https://github.com/speclynx/apidom/compare/v3.2.0...v3.2.1) (2026-03-09)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-json-3-0
|
|
13
|
+
|
|
6
14
|
# [3.2.0](https://github.com/speclynx/apidom/compare/v3.1.0...v3.2.0) (2026-03-08)
|
|
7
15
|
|
|
8
16
|
### Features
|
|
@@ -33087,13 +33087,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33087
33087
|
/* harmony export */ });
|
|
33088
33088
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9498);
|
|
33089
33089
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4066);
|
|
33090
|
-
/* harmony import */ var
|
|
33091
|
-
/* harmony import */ var
|
|
33092
|
-
/* harmony import */ var
|
|
33093
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
33094
|
-
/* harmony import */ var
|
|
33095
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4367);
|
|
33096
|
-
|
|
33090
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4673);
|
|
33091
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1767);
|
|
33092
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8933);
|
|
33093
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2131);
|
|
33094
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4367);
|
|
33097
33095
|
|
|
33098
33096
|
|
|
33099
33097
|
|
|
@@ -33106,29 +33104,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33106
33104
|
/**
|
|
33107
33105
|
* @public
|
|
33108
33106
|
*/
|
|
33109
|
-
class ResponsesVisitor extends
|
|
33107
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor {
|
|
33110
33108
|
constructor(options) {
|
|
33111
33109
|
super(options);
|
|
33112
|
-
this.element = new
|
|
33110
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
33113
33111
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
33114
33112
|
this.canSupportSpecificationExtensions = true;
|
|
33115
|
-
this.specPathPatternedFields = element => (0,
|
|
33113
|
+
this.specPathPatternedFields = element => (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
33116
33114
|
this.fieldPatternPredicate = value => new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`).test(String(value));
|
|
33117
33115
|
}
|
|
33118
33116
|
ObjectElement(path) {
|
|
33119
|
-
|
|
33117
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
33120
33118
|
|
|
33121
33119
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
33122
33120
|
// @ts-ignore
|
|
33123
|
-
this.element.filter(
|
|
33121
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceElement).forEach(referenceElement => {
|
|
33124
33122
|
referenceElement.meta.set('referenced-element', 'response');
|
|
33125
33123
|
});
|
|
33126
33124
|
|
|
33127
33125
|
// decorate every ResponseElement with metadata about their status code
|
|
33128
33126
|
// @ts-ignore
|
|
33129
|
-
this.element.filter(
|
|
33130
|
-
const httpStatusCode = (0,
|
|
33131
|
-
if (!this.fieldPatternPredicate(
|
|
33127
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isResponseElement).forEach((value, key) => {
|
|
33128
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
33129
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
33132
33130
|
value.meta.set('http-status-code', httpStatusCode);
|
|
33133
33131
|
});
|
|
33134
33132
|
}
|
|
@@ -34362,7 +34360,9 @@ class Path {
|
|
|
34362
34360
|
*
|
|
34363
34361
|
* @example
|
|
34364
34362
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
34363
|
+
* ```
|
|
34365
34364
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
34365
|
+
* ```
|
|
34366
34366
|
*/
|
|
34367
34367
|
getPathKeys() {
|
|
34368
34368
|
const keys = [];
|
|
@@ -34397,18 +34397,22 @@ class Path {
|
|
|
34397
34397
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
34398
34398
|
*
|
|
34399
34399
|
* @example
|
|
34400
|
+
* ```
|
|
34400
34401
|
* // JSON Pointer examples:
|
|
34401
34402
|
* path.formatPath(); // "" (root)
|
|
34402
34403
|
* path.formatPath(); // "/info"
|
|
34403
34404
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
34404
34405
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
34406
|
+
* ```
|
|
34405
34407
|
*
|
|
34406
34408
|
* @example
|
|
34409
|
+
* ```
|
|
34407
34410
|
* // JSONPath examples:
|
|
34408
34411
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
34409
34412
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
34410
34413
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
34411
34414
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
34415
|
+
* ```
|
|
34412
34416
|
*/
|
|
34413
34417
|
formatPath(pathFormat = 'jsonpointer') {
|
|
34414
34418
|
const parts = this.getPathKeys();
|
|
@@ -34618,15 +34622,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34618
34622
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2078);
|
|
34619
34623
|
|
|
34620
34624
|
/**
|
|
34621
|
-
* Finds all elements
|
|
34625
|
+
* Finds all paths whose elements match the predicate.
|
|
34622
34626
|
* @public
|
|
34623
34627
|
*/
|
|
34624
34628
|
const filter = (element, predicate) => {
|
|
34625
34629
|
const result = [];
|
|
34626
34630
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
34627
34631
|
enter(path) {
|
|
34628
|
-
if (predicate(path
|
|
34629
|
-
result.push(path
|
|
34632
|
+
if (predicate(path)) {
|
|
34633
|
+
result.push(path);
|
|
34630
34634
|
}
|
|
34631
34635
|
}
|
|
34632
34636
|
});
|
|
@@ -34652,7 +34656,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34652
34656
|
* @public
|
|
34653
34657
|
*/
|
|
34654
34658
|
/**
|
|
34655
|
-
* Finds the most inner node at the given offset.
|
|
34659
|
+
* Finds the path of the most inner node at the given offset.
|
|
34656
34660
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
34657
34661
|
* @public
|
|
34658
34662
|
*/
|
|
@@ -34677,7 +34681,7 @@ const findAtOffset = (element, options) => {
|
|
|
34677
34681
|
const endOffset = node.endOffset;
|
|
34678
34682
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
34679
34683
|
if (isWithinOffsetRange) {
|
|
34680
|
-
result.push(
|
|
34684
|
+
result.push(path);
|
|
34681
34685
|
return; // push to stack and dive in
|
|
34682
34686
|
}
|
|
34683
34687
|
path.skip(); // skip entire sub-tree
|
|
@@ -34700,15 +34704,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34700
34704
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2078);
|
|
34701
34705
|
|
|
34702
34706
|
/**
|
|
34703
|
-
*
|
|
34707
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
34704
34708
|
* @public
|
|
34705
34709
|
*/
|
|
34706
34710
|
const find = (element, predicate) => {
|
|
34707
34711
|
let result;
|
|
34708
34712
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
34709
34713
|
enter(path) {
|
|
34710
|
-
if (predicate(path
|
|
34711
|
-
result = path
|
|
34714
|
+
if (predicate(path)) {
|
|
34715
|
+
result = path;
|
|
34712
34716
|
path.stop();
|
|
34713
34717
|
}
|
|
34714
34718
|
}
|
|
@@ -34727,9 +34731,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34727
34731
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
34728
34732
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
34729
34733
|
/* harmony export */ });
|
|
34730
|
-
/* harmony import */ var
|
|
34731
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2078);
|
|
34732
|
-
|
|
34734
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2078);
|
|
34733
34735
|
|
|
34734
34736
|
/**
|
|
34735
34737
|
* @public
|
|
@@ -34738,7 +34740,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34738
34740
|
* @public
|
|
34739
34741
|
*/
|
|
34740
34742
|
/**
|
|
34741
|
-
* Executes the callback on this element and all
|
|
34743
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
34742
34744
|
* @public
|
|
34743
34745
|
*/
|
|
34744
34746
|
const forEach = (element, options) => {
|
|
@@ -34746,15 +34748,15 @@ const forEach = (element, options) => {
|
|
|
34746
34748
|
let predicate;
|
|
34747
34749
|
if (typeof options === 'function') {
|
|
34748
34750
|
callback = options;
|
|
34749
|
-
predicate =
|
|
34751
|
+
predicate = () => true;
|
|
34750
34752
|
} else {
|
|
34751
34753
|
callback = options.callback ?? (() => {});
|
|
34752
|
-
predicate = options.predicate ??
|
|
34754
|
+
predicate = options.predicate ?? (() => true);
|
|
34753
34755
|
}
|
|
34754
|
-
(0,
|
|
34756
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
34755
34757
|
enter(path) {
|
|
34756
|
-
if (predicate(path
|
|
34757
|
-
callback(path
|
|
34758
|
+
if (predicate(path)) {
|
|
34759
|
+
callback(path);
|
|
34758
34760
|
}
|
|
34759
34761
|
}
|
|
34760
34762
|
});
|
|
@@ -34803,11 +34805,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34803
34805
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5247);
|
|
34804
34806
|
|
|
34805
34807
|
/**
|
|
34806
|
-
* Complement of filter. Finds all elements NOT
|
|
34808
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
34807
34809
|
* @public
|
|
34808
34810
|
*/
|
|
34809
34811
|
const reject = (element, predicate) => {
|
|
34810
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
34812
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
34811
34813
|
};
|
|
34812
34814
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
34813
34815
|
|
|
@@ -34824,7 +34826,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34824
34826
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4860);
|
|
34825
34827
|
|
|
34826
34828
|
/**
|
|
34827
|
-
* Tests whether at least one element passes the predicate.
|
|
34829
|
+
* Tests whether at least one path's element passes the predicate.
|
|
34828
34830
|
* @public
|
|
34829
34831
|
*/
|
|
34830
34832
|
const some = (element, predicate) => {
|