@speclynx/apidom-parser-adapter-openapi-yaml-2 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-2.browser.js +49 -49
- package/dist/apidom-parser-adapter-openapi-yaml-2.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-2
|
|
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-2
|
|
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
|
|
@@ -41041,11 +41041,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41041
41041
|
/* harmony export */ });
|
|
41042
41042
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
41043
41043
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
|
|
41044
|
-
/* harmony import */ var
|
|
41045
|
-
/* harmony import */ var
|
|
41046
|
-
/* harmony import */ var
|
|
41047
|
-
/* harmony import */ var
|
|
41048
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(75107);
|
|
41044
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
41045
|
+
/* harmony import */ var _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(83419);
|
|
41046
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
41047
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75107);
|
|
41049
41048
|
|
|
41050
41049
|
|
|
41051
41050
|
|
|
@@ -41055,23 +41054,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41055
41054
|
/**
|
|
41056
41055
|
* @public
|
|
41057
41056
|
*/
|
|
41058
|
-
class PathItemVisitor extends
|
|
41057
|
+
class PathItemVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor {
|
|
41059
41058
|
constructor(options) {
|
|
41060
41059
|
super(options);
|
|
41061
|
-
this.element = new
|
|
41060
|
+
this.element = new _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
41062
41061
|
this.consumeSafe = true;
|
|
41063
41062
|
this.specPath = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'PathItem']);
|
|
41064
41063
|
}
|
|
41065
41064
|
ObjectElement(path) {
|
|
41066
|
-
|
|
41065
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
41067
41066
|
|
|
41068
41067
|
// decorate Operation elements with HTTP method
|
|
41069
|
-
this.element.filter(
|
|
41068
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isOperationElement)
|
|
41070
41069
|
// @ts-ignore
|
|
41071
41070
|
.forEach((operationElement, httpMethodElementCI) => {
|
|
41072
|
-
const
|
|
41073
|
-
|
|
41074
|
-
operationElement.meta.set('http-method', httpMethodElementCS);
|
|
41071
|
+
const httpMethod = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(httpMethodElementCI).toUpperCase();
|
|
41072
|
+
operationElement.meta.set('http-method', httpMethod);
|
|
41075
41073
|
});
|
|
41076
41074
|
|
|
41077
41075
|
// mark this PathItemElement with reference metadata
|
|
@@ -41094,7 +41092,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41094
41092
|
/* harmony export */ });
|
|
41095
41093
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53679);
|
|
41096
41094
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29498);
|
|
41097
|
-
/* harmony import */ var
|
|
41095
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
41098
41096
|
/* harmony import */ var _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(38253);
|
|
41099
41097
|
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26365);
|
|
41100
41098
|
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(75107);
|
|
@@ -41125,7 +41123,7 @@ class PathsVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_5__.BasePatterned
|
|
|
41125
41123
|
.forEach((pathItemElement, key) => {
|
|
41126
41124
|
key.classes.push('openapi-path-template');
|
|
41127
41125
|
key.classes.push('path-template');
|
|
41128
|
-
pathItemElement.meta.set('path', (0,
|
|
41126
|
+
pathItemElement.meta.set('path', (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key));
|
|
41129
41127
|
});
|
|
41130
41128
|
}
|
|
41131
41129
|
}
|
|
@@ -41310,13 +41308,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41310
41308
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
41311
41309
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
41312
41310
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32343);
|
|
41313
|
-
/* harmony import */ var
|
|
41314
|
-
/* harmony import */ var
|
|
41315
|
-
/* harmony import */ var
|
|
41316
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
41317
|
-
/* harmony import */ var
|
|
41318
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(75107);
|
|
41319
|
-
|
|
41311
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44673);
|
|
41312
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31297);
|
|
41313
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72880);
|
|
41314
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26365);
|
|
41315
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75107);
|
|
41320
41316
|
|
|
41321
41317
|
|
|
41322
41318
|
|
|
@@ -41326,32 +41322,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41326
41322
|
/**
|
|
41327
41323
|
* @public
|
|
41328
41324
|
*/
|
|
41329
|
-
class ResponsesVisitor extends
|
|
41325
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_7__.BaseMixedFieldsVisitor {
|
|
41330
41326
|
constructor(options) {
|
|
41331
41327
|
super(options);
|
|
41332
|
-
this.element = new
|
|
41328
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
41333
41329
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
41334
41330
|
this.canSupportSpecificationExtensions = true;
|
|
41335
41331
|
this.specPathPatternedFields = element => {
|
|
41336
|
-
return (0,
|
|
41332
|
+
return (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
41337
41333
|
};
|
|
41338
41334
|
// @ts-ignore
|
|
41339
41335
|
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('|')})$`));
|
|
41340
41336
|
}
|
|
41341
41337
|
ObjectElement(path) {
|
|
41342
|
-
|
|
41338
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_7__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
41343
41339
|
|
|
41344
41340
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
41345
41341
|
// @ts-ignore
|
|
41346
|
-
this.element.filter(
|
|
41342
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__.isReferenceElement).forEach(referenceElement => {
|
|
41347
41343
|
referenceElement.meta.set('referenced-element', 'response');
|
|
41348
41344
|
});
|
|
41349
41345
|
|
|
41350
41346
|
// decorate every ResponseElement with metadata about their status code
|
|
41351
41347
|
// @ts-ignore
|
|
41352
|
-
this.element.filter(
|
|
41353
|
-
const httpStatusCode = (0,
|
|
41354
|
-
if (!this.fieldPatternPredicate(
|
|
41348
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__.isResponseElement).forEach((value, key) => {
|
|
41349
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_3__["default"])(key);
|
|
41350
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
41355
41351
|
value.meta.set('http-status-code', httpStatusCode);
|
|
41356
41352
|
});
|
|
41357
41353
|
}
|
|
@@ -44785,7 +44781,9 @@ class Path {
|
|
|
44785
44781
|
*
|
|
44786
44782
|
* @example
|
|
44787
44783
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
44784
|
+
* ```
|
|
44788
44785
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
44786
|
+
* ```
|
|
44789
44787
|
*/
|
|
44790
44788
|
getPathKeys() {
|
|
44791
44789
|
const keys = [];
|
|
@@ -44820,18 +44818,22 @@ class Path {
|
|
|
44820
44818
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
44821
44819
|
*
|
|
44822
44820
|
* @example
|
|
44821
|
+
* ```
|
|
44823
44822
|
* // JSON Pointer examples:
|
|
44824
44823
|
* path.formatPath(); // "" (root)
|
|
44825
44824
|
* path.formatPath(); // "/info"
|
|
44826
44825
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
44827
44826
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
44827
|
+
* ```
|
|
44828
44828
|
*
|
|
44829
44829
|
* @example
|
|
44830
|
+
* ```
|
|
44830
44831
|
* // JSONPath examples:
|
|
44831
44832
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
44832
44833
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
44833
44834
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
44834
44835
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
44836
|
+
* ```
|
|
44835
44837
|
*/
|
|
44836
44838
|
formatPath(pathFormat = 'jsonpointer') {
|
|
44837
44839
|
const parts = this.getPathKeys();
|
|
@@ -45041,15 +45043,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45041
45043
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
45042
45044
|
|
|
45043
45045
|
/**
|
|
45044
|
-
* Finds all elements
|
|
45046
|
+
* Finds all paths whose elements match the predicate.
|
|
45045
45047
|
* @public
|
|
45046
45048
|
*/
|
|
45047
45049
|
const filter = (element, predicate) => {
|
|
45048
45050
|
const result = [];
|
|
45049
45051
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
45050
45052
|
enter(path) {
|
|
45051
|
-
if (predicate(path
|
|
45052
|
-
result.push(path
|
|
45053
|
+
if (predicate(path)) {
|
|
45054
|
+
result.push(path);
|
|
45053
45055
|
}
|
|
45054
45056
|
}
|
|
45055
45057
|
});
|
|
@@ -45075,7 +45077,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45075
45077
|
* @public
|
|
45076
45078
|
*/
|
|
45077
45079
|
/**
|
|
45078
|
-
* Finds the most inner node at the given offset.
|
|
45080
|
+
* Finds the path of the most inner node at the given offset.
|
|
45079
45081
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
45080
45082
|
* @public
|
|
45081
45083
|
*/
|
|
@@ -45100,7 +45102,7 @@ const findAtOffset = (element, options) => {
|
|
|
45100
45102
|
const endOffset = node.endOffset;
|
|
45101
45103
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
45102
45104
|
if (isWithinOffsetRange) {
|
|
45103
|
-
result.push(
|
|
45105
|
+
result.push(path);
|
|
45104
45106
|
return; // push to stack and dive in
|
|
45105
45107
|
}
|
|
45106
45108
|
path.skip(); // skip entire sub-tree
|
|
@@ -45123,15 +45125,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45123
45125
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
45124
45126
|
|
|
45125
45127
|
/**
|
|
45126
|
-
*
|
|
45128
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
45127
45129
|
* @public
|
|
45128
45130
|
*/
|
|
45129
45131
|
const find = (element, predicate) => {
|
|
45130
45132
|
let result;
|
|
45131
45133
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
45132
45134
|
enter(path) {
|
|
45133
|
-
if (predicate(path
|
|
45134
|
-
result = path
|
|
45135
|
+
if (predicate(path)) {
|
|
45136
|
+
result = path;
|
|
45135
45137
|
path.stop();
|
|
45136
45138
|
}
|
|
45137
45139
|
}
|
|
@@ -45150,9 +45152,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45150
45152
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45151
45153
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
45152
45154
|
/* harmony export */ });
|
|
45153
|
-
/* harmony import */ var
|
|
45154
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72078);
|
|
45155
|
-
|
|
45155
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
45156
45156
|
|
|
45157
45157
|
/**
|
|
45158
45158
|
* @public
|
|
@@ -45161,7 +45161,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45161
45161
|
* @public
|
|
45162
45162
|
*/
|
|
45163
45163
|
/**
|
|
45164
|
-
* Executes the callback on this element and all
|
|
45164
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
45165
45165
|
* @public
|
|
45166
45166
|
*/
|
|
45167
45167
|
const forEach = (element, options) => {
|
|
@@ -45169,15 +45169,15 @@ const forEach = (element, options) => {
|
|
|
45169
45169
|
let predicate;
|
|
45170
45170
|
if (typeof options === 'function') {
|
|
45171
45171
|
callback = options;
|
|
45172
|
-
predicate =
|
|
45172
|
+
predicate = () => true;
|
|
45173
45173
|
} else {
|
|
45174
45174
|
callback = options.callback ?? (() => {});
|
|
45175
|
-
predicate = options.predicate ??
|
|
45175
|
+
predicate = options.predicate ?? (() => true);
|
|
45176
45176
|
}
|
|
45177
|
-
(0,
|
|
45177
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
45178
45178
|
enter(path) {
|
|
45179
|
-
if (predicate(path
|
|
45180
|
-
callback(path
|
|
45179
|
+
if (predicate(path)) {
|
|
45180
|
+
callback(path);
|
|
45181
45181
|
}
|
|
45182
45182
|
}
|
|
45183
45183
|
});
|
|
@@ -45226,11 +45226,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45226
45226
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75247);
|
|
45227
45227
|
|
|
45228
45228
|
/**
|
|
45229
|
-
* Complement of filter. Finds all elements NOT
|
|
45229
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
45230
45230
|
* @public
|
|
45231
45231
|
*/
|
|
45232
45232
|
const reject = (element, predicate) => {
|
|
45233
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
45233
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
45234
45234
|
};
|
|
45235
45235
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
45236
45236
|
|
|
@@ -45247,7 +45247,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45247
45247
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44860);
|
|
45248
45248
|
|
|
45249
45249
|
/**
|
|
45250
|
-
* Tests whether at least one element passes the predicate.
|
|
45250
|
+
* Tests whether at least one path's element passes the predicate.
|
|
45251
45251
|
* @public
|
|
45252
45252
|
*/
|
|
45253
45253
|
const some = (element, predicate) => {
|