@speclynx/apidom-parser-adapter-openapi-yaml-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-yaml-3-0.browser.js +37 -35
- package/dist/apidom-parser-adapter-openapi-yaml-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-yaml-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-yaml-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
|
|
@@ -43464,13 +43464,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43464
43464
|
/* harmony export */ });
|
|
43465
43465
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
43466
43466
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
43467
|
-
/* harmony import */ var
|
|
43468
|
-
/* harmony import */ var
|
|
43469
|
-
/* harmony import */ var
|
|
43470
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
43471
|
-
/* harmony import */ var
|
|
43472
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74367);
|
|
43473
|
-
|
|
43467
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
43468
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71767);
|
|
43469
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21314);
|
|
43470
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32131);
|
|
43471
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74367);
|
|
43474
43472
|
|
|
43475
43473
|
|
|
43476
43474
|
|
|
@@ -43483,29 +43481,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43483
43481
|
/**
|
|
43484
43482
|
* @public
|
|
43485
43483
|
*/
|
|
43486
|
-
class ResponsesVisitor extends
|
|
43484
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor {
|
|
43487
43485
|
constructor(options) {
|
|
43488
43486
|
super(options);
|
|
43489
|
-
this.element = new
|
|
43487
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
43490
43488
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
43491
43489
|
this.canSupportSpecificationExtensions = true;
|
|
43492
|
-
this.specPathPatternedFields = element => (0,
|
|
43490
|
+
this.specPathPatternedFields = element => (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
43493
43491
|
this.fieldPatternPredicate = value => new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`).test(String(value));
|
|
43494
43492
|
}
|
|
43495
43493
|
ObjectElement(path) {
|
|
43496
|
-
|
|
43494
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
43497
43495
|
|
|
43498
43496
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
43499
43497
|
// @ts-ignore
|
|
43500
|
-
this.element.filter(
|
|
43498
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceElement).forEach(referenceElement => {
|
|
43501
43499
|
referenceElement.meta.set('referenced-element', 'response');
|
|
43502
43500
|
});
|
|
43503
43501
|
|
|
43504
43502
|
// decorate every ResponseElement with metadata about their status code
|
|
43505
43503
|
// @ts-ignore
|
|
43506
|
-
this.element.filter(
|
|
43507
|
-
const httpStatusCode = (0,
|
|
43508
|
-
if (!this.fieldPatternPredicate(
|
|
43504
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isResponseElement).forEach((value, key) => {
|
|
43505
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
43506
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
43509
43507
|
value.meta.set('http-status-code', httpStatusCode);
|
|
43510
43508
|
});
|
|
43511
43509
|
}
|
|
@@ -47089,7 +47087,9 @@ class Path {
|
|
|
47089
47087
|
*
|
|
47090
47088
|
* @example
|
|
47091
47089
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
47090
|
+
* ```
|
|
47092
47091
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
47092
|
+
* ```
|
|
47093
47093
|
*/
|
|
47094
47094
|
getPathKeys() {
|
|
47095
47095
|
const keys = [];
|
|
@@ -47124,18 +47124,22 @@ class Path {
|
|
|
47124
47124
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
47125
47125
|
*
|
|
47126
47126
|
* @example
|
|
47127
|
+
* ```
|
|
47127
47128
|
* // JSON Pointer examples:
|
|
47128
47129
|
* path.formatPath(); // "" (root)
|
|
47129
47130
|
* path.formatPath(); // "/info"
|
|
47130
47131
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
47131
47132
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
47133
|
+
* ```
|
|
47132
47134
|
*
|
|
47133
47135
|
* @example
|
|
47136
|
+
* ```
|
|
47134
47137
|
* // JSONPath examples:
|
|
47135
47138
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
47136
47139
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
47137
47140
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
47138
47141
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
47142
|
+
* ```
|
|
47139
47143
|
*/
|
|
47140
47144
|
formatPath(pathFormat = 'jsonpointer') {
|
|
47141
47145
|
const parts = this.getPathKeys();
|
|
@@ -47345,15 +47349,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47345
47349
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
47346
47350
|
|
|
47347
47351
|
/**
|
|
47348
|
-
* Finds all elements
|
|
47352
|
+
* Finds all paths whose elements match the predicate.
|
|
47349
47353
|
* @public
|
|
47350
47354
|
*/
|
|
47351
47355
|
const filter = (element, predicate) => {
|
|
47352
47356
|
const result = [];
|
|
47353
47357
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
47354
47358
|
enter(path) {
|
|
47355
|
-
if (predicate(path
|
|
47356
|
-
result.push(path
|
|
47359
|
+
if (predicate(path)) {
|
|
47360
|
+
result.push(path);
|
|
47357
47361
|
}
|
|
47358
47362
|
}
|
|
47359
47363
|
});
|
|
@@ -47379,7 +47383,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47379
47383
|
* @public
|
|
47380
47384
|
*/
|
|
47381
47385
|
/**
|
|
47382
|
-
* Finds the most inner node at the given offset.
|
|
47386
|
+
* Finds the path of the most inner node at the given offset.
|
|
47383
47387
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
47384
47388
|
* @public
|
|
47385
47389
|
*/
|
|
@@ -47404,7 +47408,7 @@ const findAtOffset = (element, options) => {
|
|
|
47404
47408
|
const endOffset = node.endOffset;
|
|
47405
47409
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
47406
47410
|
if (isWithinOffsetRange) {
|
|
47407
|
-
result.push(
|
|
47411
|
+
result.push(path);
|
|
47408
47412
|
return; // push to stack and dive in
|
|
47409
47413
|
}
|
|
47410
47414
|
path.skip(); // skip entire sub-tree
|
|
@@ -47427,15 +47431,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47427
47431
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
47428
47432
|
|
|
47429
47433
|
/**
|
|
47430
|
-
*
|
|
47434
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
47431
47435
|
* @public
|
|
47432
47436
|
*/
|
|
47433
47437
|
const find = (element, predicate) => {
|
|
47434
47438
|
let result;
|
|
47435
47439
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
47436
47440
|
enter(path) {
|
|
47437
|
-
if (predicate(path
|
|
47438
|
-
result = path
|
|
47441
|
+
if (predicate(path)) {
|
|
47442
|
+
result = path;
|
|
47439
47443
|
path.stop();
|
|
47440
47444
|
}
|
|
47441
47445
|
}
|
|
@@ -47454,9 +47458,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47454
47458
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
47455
47459
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
47456
47460
|
/* harmony export */ });
|
|
47457
|
-
/* harmony import */ var
|
|
47458
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72078);
|
|
47459
|
-
|
|
47461
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
47460
47462
|
|
|
47461
47463
|
/**
|
|
47462
47464
|
* @public
|
|
@@ -47465,7 +47467,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47465
47467
|
* @public
|
|
47466
47468
|
*/
|
|
47467
47469
|
/**
|
|
47468
|
-
* Executes the callback on this element and all
|
|
47470
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
47469
47471
|
* @public
|
|
47470
47472
|
*/
|
|
47471
47473
|
const forEach = (element, options) => {
|
|
@@ -47473,15 +47475,15 @@ const forEach = (element, options) => {
|
|
|
47473
47475
|
let predicate;
|
|
47474
47476
|
if (typeof options === 'function') {
|
|
47475
47477
|
callback = options;
|
|
47476
|
-
predicate =
|
|
47478
|
+
predicate = () => true;
|
|
47477
47479
|
} else {
|
|
47478
47480
|
callback = options.callback ?? (() => {});
|
|
47479
|
-
predicate = options.predicate ??
|
|
47481
|
+
predicate = options.predicate ?? (() => true);
|
|
47480
47482
|
}
|
|
47481
|
-
(0,
|
|
47483
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
47482
47484
|
enter(path) {
|
|
47483
|
-
if (predicate(path
|
|
47484
|
-
callback(path
|
|
47485
|
+
if (predicate(path)) {
|
|
47486
|
+
callback(path);
|
|
47485
47487
|
}
|
|
47486
47488
|
}
|
|
47487
47489
|
});
|
|
@@ -47530,11 +47532,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47530
47532
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75247);
|
|
47531
47533
|
|
|
47532
47534
|
/**
|
|
47533
|
-
* Complement of filter. Finds all elements NOT
|
|
47535
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
47534
47536
|
* @public
|
|
47535
47537
|
*/
|
|
47536
47538
|
const reject = (element, predicate) => {
|
|
47537
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
47539
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
47538
47540
|
};
|
|
47539
47541
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
47540
47542
|
|
|
@@ -47551,7 +47553,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47551
47553
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44860);
|
|
47552
47554
|
|
|
47553
47555
|
/**
|
|
47554
|
-
* Tests whether at least one element passes the predicate.
|
|
47556
|
+
* Tests whether at least one path's element passes the predicate.
|
|
47555
47557
|
* @public
|
|
47556
47558
|
*/
|
|
47557
47559
|
const some = (element, predicate) => {
|