@speclynx/apidom-parser-adapter-openapi-yaml-3-1 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-yaml-3-1.browser.js +37 -35
- package/dist/apidom-parser-adapter-openapi-yaml-3-1.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-yaml-3-1
|
|
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-yaml-3-1
|
|
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
|
|
@@ -45235,13 +45235,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45235
45235
|
/* harmony export */ });
|
|
45236
45236
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
45237
45237
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
45238
|
-
/* harmony import */ var
|
|
45239
|
-
/* harmony import */ var
|
|
45240
|
-
/* harmony import */ var
|
|
45241
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
45242
|
-
/* harmony import */ var
|
|
45243
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74367);
|
|
45244
|
-
|
|
45238
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
45239
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71767);
|
|
45240
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21314);
|
|
45241
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32131);
|
|
45242
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74367);
|
|
45245
45243
|
|
|
45246
45244
|
|
|
45247
45245
|
|
|
@@ -45254,29 +45252,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45254
45252
|
/**
|
|
45255
45253
|
* @public
|
|
45256
45254
|
*/
|
|
45257
|
-
class ResponsesVisitor extends
|
|
45255
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor {
|
|
45258
45256
|
constructor(options) {
|
|
45259
45257
|
super(options);
|
|
45260
|
-
this.element = new
|
|
45258
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
45261
45259
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
45262
45260
|
this.canSupportSpecificationExtensions = true;
|
|
45263
|
-
this.specPathPatternedFields = element => (0,
|
|
45261
|
+
this.specPathPatternedFields = element => (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
45264
45262
|
this.fieldPatternPredicate = value => new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`).test(String(value));
|
|
45265
45263
|
}
|
|
45266
45264
|
ObjectElement(path) {
|
|
45267
|
-
|
|
45265
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
45268
45266
|
|
|
45269
45267
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
45270
45268
|
// @ts-ignore
|
|
45271
|
-
this.element.filter(
|
|
45269
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceElement).forEach(referenceElement => {
|
|
45272
45270
|
referenceElement.meta.set('referenced-element', 'response');
|
|
45273
45271
|
});
|
|
45274
45272
|
|
|
45275
45273
|
// decorate every ResponseElement with metadata about their status code
|
|
45276
45274
|
// @ts-ignore
|
|
45277
|
-
this.element.filter(
|
|
45278
|
-
const httpStatusCode = (0,
|
|
45279
|
-
if (!this.fieldPatternPredicate(
|
|
45275
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isResponseElement).forEach((value, key) => {
|
|
45276
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
45277
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
45280
45278
|
value.meta.set('http-status-code', httpStatusCode);
|
|
45281
45279
|
});
|
|
45282
45280
|
}
|
|
@@ -52698,7 +52696,9 @@ class Path {
|
|
|
52698
52696
|
*
|
|
52699
52697
|
* @example
|
|
52700
52698
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
52699
|
+
* ```
|
|
52701
52700
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
52701
|
+
* ```
|
|
52702
52702
|
*/
|
|
52703
52703
|
getPathKeys() {
|
|
52704
52704
|
const keys = [];
|
|
@@ -52733,18 +52733,22 @@ class Path {
|
|
|
52733
52733
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
52734
52734
|
*
|
|
52735
52735
|
* @example
|
|
52736
|
+
* ```
|
|
52736
52737
|
* // JSON Pointer examples:
|
|
52737
52738
|
* path.formatPath(); // "" (root)
|
|
52738
52739
|
* path.formatPath(); // "/info"
|
|
52739
52740
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
52740
52741
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
52742
|
+
* ```
|
|
52741
52743
|
*
|
|
52742
52744
|
* @example
|
|
52745
|
+
* ```
|
|
52743
52746
|
* // JSONPath examples:
|
|
52744
52747
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
52745
52748
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
52746
52749
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
52747
52750
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
52751
|
+
* ```
|
|
52748
52752
|
*/
|
|
52749
52753
|
formatPath(pathFormat = 'jsonpointer') {
|
|
52750
52754
|
const parts = this.getPathKeys();
|
|
@@ -52954,15 +52958,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
52954
52958
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
52955
52959
|
|
|
52956
52960
|
/**
|
|
52957
|
-
* Finds all elements
|
|
52961
|
+
* Finds all paths whose elements match the predicate.
|
|
52958
52962
|
* @public
|
|
52959
52963
|
*/
|
|
52960
52964
|
const filter = (element, predicate) => {
|
|
52961
52965
|
const result = [];
|
|
52962
52966
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
52963
52967
|
enter(path) {
|
|
52964
|
-
if (predicate(path
|
|
52965
|
-
result.push(path
|
|
52968
|
+
if (predicate(path)) {
|
|
52969
|
+
result.push(path);
|
|
52966
52970
|
}
|
|
52967
52971
|
}
|
|
52968
52972
|
});
|
|
@@ -52988,7 +52992,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
52988
52992
|
* @public
|
|
52989
52993
|
*/
|
|
52990
52994
|
/**
|
|
52991
|
-
* Finds the most inner node at the given offset.
|
|
52995
|
+
* Finds the path of the most inner node at the given offset.
|
|
52992
52996
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
52993
52997
|
* @public
|
|
52994
52998
|
*/
|
|
@@ -53013,7 +53017,7 @@ const findAtOffset = (element, options) => {
|
|
|
53013
53017
|
const endOffset = node.endOffset;
|
|
53014
53018
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
53015
53019
|
if (isWithinOffsetRange) {
|
|
53016
|
-
result.push(
|
|
53020
|
+
result.push(path);
|
|
53017
53021
|
return; // push to stack and dive in
|
|
53018
53022
|
}
|
|
53019
53023
|
path.skip(); // skip entire sub-tree
|
|
@@ -53036,15 +53040,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53036
53040
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
53037
53041
|
|
|
53038
53042
|
/**
|
|
53039
|
-
*
|
|
53043
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
53040
53044
|
* @public
|
|
53041
53045
|
*/
|
|
53042
53046
|
const find = (element, predicate) => {
|
|
53043
53047
|
let result;
|
|
53044
53048
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
53045
53049
|
enter(path) {
|
|
53046
|
-
if (predicate(path
|
|
53047
|
-
result = path
|
|
53050
|
+
if (predicate(path)) {
|
|
53051
|
+
result = path;
|
|
53048
53052
|
path.stop();
|
|
53049
53053
|
}
|
|
53050
53054
|
}
|
|
@@ -53063,9 +53067,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53063
53067
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
53064
53068
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
53065
53069
|
/* harmony export */ });
|
|
53066
|
-
/* harmony import */ var
|
|
53067
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72078);
|
|
53068
|
-
|
|
53070
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
53069
53071
|
|
|
53070
53072
|
/**
|
|
53071
53073
|
* @public
|
|
@@ -53074,7 +53076,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53074
53076
|
* @public
|
|
53075
53077
|
*/
|
|
53076
53078
|
/**
|
|
53077
|
-
* Executes the callback on this element and all
|
|
53079
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
53078
53080
|
* @public
|
|
53079
53081
|
*/
|
|
53080
53082
|
const forEach = (element, options) => {
|
|
@@ -53082,15 +53084,15 @@ const forEach = (element, options) => {
|
|
|
53082
53084
|
let predicate;
|
|
53083
53085
|
if (typeof options === 'function') {
|
|
53084
53086
|
callback = options;
|
|
53085
|
-
predicate =
|
|
53087
|
+
predicate = () => true;
|
|
53086
53088
|
} else {
|
|
53087
53089
|
callback = options.callback ?? (() => {});
|
|
53088
|
-
predicate = options.predicate ??
|
|
53090
|
+
predicate = options.predicate ?? (() => true);
|
|
53089
53091
|
}
|
|
53090
|
-
(0,
|
|
53092
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
53091
53093
|
enter(path) {
|
|
53092
|
-
if (predicate(path
|
|
53093
|
-
callback(path
|
|
53094
|
+
if (predicate(path)) {
|
|
53095
|
+
callback(path);
|
|
53094
53096
|
}
|
|
53095
53097
|
}
|
|
53096
53098
|
});
|
|
@@ -53139,11 +53141,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53139
53141
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75247);
|
|
53140
53142
|
|
|
53141
53143
|
/**
|
|
53142
|
-
* Complement of filter. Finds all elements NOT
|
|
53144
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
53143
53145
|
* @public
|
|
53144
53146
|
*/
|
|
53145
53147
|
const reject = (element, predicate) => {
|
|
53146
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
53148
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
53147
53149
|
};
|
|
53148
53150
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
53149
53151
|
|
|
@@ -53160,7 +53162,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53160
53162
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44860);
|
|
53161
53163
|
|
|
53162
53164
|
/**
|
|
53163
|
-
* Tests whether at least one element passes the predicate.
|
|
53165
|
+
* Tests whether at least one path's element passes the predicate.
|
|
53164
53166
|
* @public
|
|
53165
53167
|
*/
|
|
53166
53168
|
const some = (element, predicate) => {
|