@speclynx/apidom-parser-adapter-openapi-json-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-json-3-1.browser.js +37 -35
- package/dist/apidom-parser-adapter-openapi-json-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-json-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-json-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
|
|
@@ -34858,13 +34858,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34858
34858
|
/* harmony export */ });
|
|
34859
34859
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(29498);
|
|
34860
34860
|
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(64066);
|
|
34861
|
-
/* harmony import */ var
|
|
34862
|
-
/* harmony import */ var
|
|
34863
|
-
/* harmony import */ var
|
|
34864
|
-
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
34865
|
-
/* harmony import */ var
|
|
34866
|
-
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(74367);
|
|
34867
|
-
|
|
34861
|
+
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44673);
|
|
34862
|
+
/* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71767);
|
|
34863
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21314);
|
|
34864
|
+
/* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32131);
|
|
34865
|
+
/* harmony import */ var _bases_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(74367);
|
|
34868
34866
|
|
|
34869
34867
|
|
|
34870
34868
|
|
|
@@ -34877,29 +34875,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34877
34875
|
/**
|
|
34878
34876
|
* @public
|
|
34879
34877
|
*/
|
|
34880
|
-
class ResponsesVisitor extends
|
|
34878
|
+
class ResponsesVisitor extends _bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor {
|
|
34881
34879
|
constructor(options) {
|
|
34882
34880
|
super(options);
|
|
34883
|
-
this.element = new
|
|
34881
|
+
this.element = new _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
34884
34882
|
this.specPathFixedFields = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(['document', 'objects', 'Responses']);
|
|
34885
34883
|
this.canSupportSpecificationExtensions = true;
|
|
34886
|
-
this.specPathPatternedFields = element => (0,
|
|
34884
|
+
this.specPathPatternedFields = element => (0,_predicates_mjs__WEBPACK_IMPORTED_MODULE_4__.isReferenceLikeElement)(element) ? ['document', 'objects', 'Reference'] : ['document', 'objects', 'Response'];
|
|
34887
34885
|
this.fieldPatternPredicate = value => new RegExp(`^(1XX|2XX|3XX|4XX|5XX|${(0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(100, 600).join('|')})$`).test(String(value));
|
|
34888
34886
|
}
|
|
34889
34887
|
ObjectElement(path) {
|
|
34890
|
-
|
|
34888
|
+
_bases_mjs__WEBPACK_IMPORTED_MODULE_6__.BaseMixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
34891
34889
|
|
|
34892
34890
|
// decorate every ReferenceElement with metadata about their referencing type
|
|
34893
34891
|
// @ts-ignore
|
|
34894
|
-
this.element.filter(
|
|
34892
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isReferenceElement).forEach(referenceElement => {
|
|
34895
34893
|
referenceElement.meta.set('referenced-element', 'response');
|
|
34896
34894
|
});
|
|
34897
34895
|
|
|
34898
34896
|
// decorate every ResponseElement with metadata about their status code
|
|
34899
34897
|
// @ts-ignore
|
|
34900
|
-
this.element.filter(
|
|
34901
|
-
const httpStatusCode = (0,
|
|
34902
|
-
if (!this.fieldPatternPredicate(
|
|
34898
|
+
this.element.filter(_predicates_mjs__WEBPACK_IMPORTED_MODULE_5__.isResponseElement).forEach((value, key) => {
|
|
34899
|
+
const httpStatusCode = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
34900
|
+
if (!this.fieldPatternPredicate(httpStatusCode)) return;
|
|
34903
34901
|
value.meta.set('http-status-code', httpStatusCode);
|
|
34904
34902
|
});
|
|
34905
34903
|
}
|
|
@@ -39971,7 +39969,9 @@ class Path {
|
|
|
39971
39969
|
*
|
|
39972
39970
|
* @example
|
|
39973
39971
|
* // For a path to $.paths['/pets'].get in an OpenAPI document:
|
|
39972
|
+
* ```
|
|
39974
39973
|
* path.getPathKeys(); // => ['paths', '/pets', 'get']
|
|
39974
|
+
* ```
|
|
39975
39975
|
*/
|
|
39976
39976
|
getPathKeys() {
|
|
39977
39977
|
const keys = [];
|
|
@@ -40006,18 +40006,22 @@ class Path {
|
|
|
40006
40006
|
* or Normalized JSONPath like "$['paths']['/pets']['get']['responses']['200']"
|
|
40007
40007
|
*
|
|
40008
40008
|
* @example
|
|
40009
|
+
* ```
|
|
40009
40010
|
* // JSON Pointer examples:
|
|
40010
40011
|
* path.formatPath(); // "" (root)
|
|
40011
40012
|
* path.formatPath(); // "/info"
|
|
40012
40013
|
* path.formatPath(); // "/paths/~1pets/get"
|
|
40013
40014
|
* path.formatPath(); // "/paths/~1users~1{id}/parameters/0"
|
|
40015
|
+
* ```
|
|
40014
40016
|
*
|
|
40015
40017
|
* @example
|
|
40018
|
+
* ```
|
|
40016
40019
|
* // JSONPath examples:
|
|
40017
40020
|
* path.formatPath('jsonpath'); // "$" (root)
|
|
40018
40021
|
* path.formatPath('jsonpath'); // "$['info']"
|
|
40019
40022
|
* path.formatPath('jsonpath'); // "$['paths']['/pets']['get']"
|
|
40020
40023
|
* path.formatPath('jsonpath'); // "$['paths']['/users/{id}']['parameters'][0]"
|
|
40024
|
+
* ```
|
|
40021
40025
|
*/
|
|
40022
40026
|
formatPath(pathFormat = 'jsonpointer') {
|
|
40023
40027
|
const parts = this.getPathKeys();
|
|
@@ -40227,15 +40231,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40227
40231
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
40228
40232
|
|
|
40229
40233
|
/**
|
|
40230
|
-
* Finds all elements
|
|
40234
|
+
* Finds all paths whose elements match the predicate.
|
|
40231
40235
|
* @public
|
|
40232
40236
|
*/
|
|
40233
40237
|
const filter = (element, predicate) => {
|
|
40234
40238
|
const result = [];
|
|
40235
40239
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
40236
40240
|
enter(path) {
|
|
40237
|
-
if (predicate(path
|
|
40238
|
-
result.push(path
|
|
40241
|
+
if (predicate(path)) {
|
|
40242
|
+
result.push(path);
|
|
40239
40243
|
}
|
|
40240
40244
|
}
|
|
40241
40245
|
});
|
|
@@ -40261,7 +40265,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40261
40265
|
* @public
|
|
40262
40266
|
*/
|
|
40263
40267
|
/**
|
|
40264
|
-
* Finds the most inner node at the given offset.
|
|
40268
|
+
* Finds the path of the most inner node at the given offset.
|
|
40265
40269
|
* If includeRightBound is set, also finds nodes that end at the given offset.
|
|
40266
40270
|
* @public
|
|
40267
40271
|
*/
|
|
@@ -40286,7 +40290,7 @@ const findAtOffset = (element, options) => {
|
|
|
40286
40290
|
const endOffset = node.endOffset;
|
|
40287
40291
|
const isWithinOffsetRange = offset >= startOffset && (offset < endOffset || includeRightBound && offset <= endOffset);
|
|
40288
40292
|
if (isWithinOffsetRange) {
|
|
40289
|
-
result.push(
|
|
40293
|
+
result.push(path);
|
|
40290
40294
|
return; // push to stack and dive in
|
|
40291
40295
|
}
|
|
40292
40296
|
path.skip(); // skip entire sub-tree
|
|
@@ -40309,15 +40313,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40309
40313
|
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
40310
40314
|
|
|
40311
40315
|
/**
|
|
40312
|
-
*
|
|
40316
|
+
* Finds first path whose element satisfies the provided predicate.
|
|
40313
40317
|
* @public
|
|
40314
40318
|
*/
|
|
40315
40319
|
const find = (element, predicate) => {
|
|
40316
40320
|
let result;
|
|
40317
40321
|
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
40318
40322
|
enter(path) {
|
|
40319
|
-
if (predicate(path
|
|
40320
|
-
result = path
|
|
40323
|
+
if (predicate(path)) {
|
|
40324
|
+
result = path;
|
|
40321
40325
|
path.stop();
|
|
40322
40326
|
}
|
|
40323
40327
|
}
|
|
@@ -40336,9 +40340,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40336
40340
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
40337
40341
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
40338
40342
|
/* harmony export */ });
|
|
40339
|
-
/* harmony import */ var
|
|
40340
|
-
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72078);
|
|
40341
|
-
|
|
40343
|
+
/* harmony import */ var _traversal_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72078);
|
|
40342
40344
|
|
|
40343
40345
|
/**
|
|
40344
40346
|
* @public
|
|
@@ -40347,7 +40349,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40347
40349
|
* @public
|
|
40348
40350
|
*/
|
|
40349
40351
|
/**
|
|
40350
|
-
* Executes the callback on this element and all
|
|
40352
|
+
* Executes the callback on this element's path and all descendant paths.
|
|
40351
40353
|
* @public
|
|
40352
40354
|
*/
|
|
40353
40355
|
const forEach = (element, options) => {
|
|
@@ -40355,15 +40357,15 @@ const forEach = (element, options) => {
|
|
|
40355
40357
|
let predicate;
|
|
40356
40358
|
if (typeof options === 'function') {
|
|
40357
40359
|
callback = options;
|
|
40358
|
-
predicate =
|
|
40360
|
+
predicate = () => true;
|
|
40359
40361
|
} else {
|
|
40360
40362
|
callback = options.callback ?? (() => {});
|
|
40361
|
-
predicate = options.predicate ??
|
|
40363
|
+
predicate = options.predicate ?? (() => true);
|
|
40362
40364
|
}
|
|
40363
|
-
(0,
|
|
40365
|
+
(0,_traversal_mjs__WEBPACK_IMPORTED_MODULE_0__.traverse)(element, {
|
|
40364
40366
|
enter(path) {
|
|
40365
|
-
if (predicate(path
|
|
40366
|
-
callback(path
|
|
40367
|
+
if (predicate(path)) {
|
|
40368
|
+
callback(path);
|
|
40367
40369
|
}
|
|
40368
40370
|
}
|
|
40369
40371
|
});
|
|
@@ -40412,11 +40414,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40412
40414
|
/* harmony import */ var _filter_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75247);
|
|
40413
40415
|
|
|
40414
40416
|
/**
|
|
40415
|
-
* Complement of filter. Finds all elements NOT
|
|
40417
|
+
* Complement of filter. Finds all paths whose elements do NOT match the predicate.
|
|
40416
40418
|
* @public
|
|
40417
40419
|
*/
|
|
40418
40420
|
const reject = (element, predicate) => {
|
|
40419
|
-
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element,
|
|
40421
|
+
return (0,_filter_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(element, path => !predicate(path));
|
|
40420
40422
|
};
|
|
40421
40423
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (reject);
|
|
40422
40424
|
|
|
@@ -40433,7 +40435,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40433
40435
|
/* harmony import */ var _find_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44860);
|
|
40434
40436
|
|
|
40435
40437
|
/**
|
|
40436
|
-
* Tests whether at least one element passes the predicate.
|
|
40438
|
+
* Tests whether at least one path's element passes the predicate.
|
|
40437
40439
|
* @public
|
|
40438
40440
|
*/
|
|
40439
40441
|
const some = (element, predicate) => {
|