@speclynx/apidom-parser-adapter-openapi-yaml-2 2.2.3 → 2.4.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 +10 -0
- package/dist/apidom-parser-adapter-openapi-yaml-2.browser.js +38 -12
- package/dist/apidom-parser-adapter-openapi-yaml-2.browser.min.js +1 -1
- package/package.json +7 -7
- package/src/adapter.cjs +4 -1
- package/src/adapter.mjs +5 -1
- package/types/apidom-parser-adapter-openapi-yaml-2.d.ts +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
# [2.4.0](https://github.com/speclynx/apidom/compare/v2.3.0...v2.4.0) (2026-01-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-yaml-2
|
|
9
|
+
|
|
10
|
+
# [2.3.0](https://github.com/speclynx/apidom/compare/v2.2.3...v2.3.0) (2026-01-27)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- support strict parsing mode through out the packages ([#46](https://github.com/speclynx/apidom/issues/46)) ([e6b47d9](https://github.com/speclynx/apidom/commit/e6b47d9cfdede7103cada67362b316fd8e5b787f)), closes [#23](https://github.com/speclynx/apidom/issues/23)
|
|
15
|
+
|
|
6
16
|
## [2.2.3](https://github.com/speclynx/apidom/compare/v2.2.2...v2.2.3) (2026-01-26)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-yaml-2
|
|
@@ -34004,7 +34004,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34004
34004
|
/* harmony export */ });
|
|
34005
34005
|
/* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53291);
|
|
34006
34006
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10404);
|
|
34007
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
34007
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84660);
|
|
34008
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
|
|
34008
34009
|
|
|
34009
34010
|
|
|
34010
34011
|
|
|
@@ -34012,9 +34013,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34012
34013
|
* @public
|
|
34013
34014
|
*/
|
|
34014
34015
|
const detect = async source => {
|
|
34016
|
+
if (source.trim().length === 0) {
|
|
34017
|
+
return false;
|
|
34018
|
+
}
|
|
34015
34019
|
try {
|
|
34016
|
-
(0,yaml__WEBPACK_IMPORTED_MODULE_0__.
|
|
34017
|
-
|
|
34020
|
+
const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
|
|
34021
|
+
version: '1.2'
|
|
34022
|
+
});
|
|
34023
|
+
// Filter out MULTIPLE_DOCS errors (handled as warning in parse)
|
|
34024
|
+
return document.errors.filter(e => e.code !== 'MULTIPLE_DOCS').length === 0;
|
|
34018
34025
|
} catch {
|
|
34019
34026
|
return false;
|
|
34020
34027
|
}
|
|
@@ -34024,9 +34031,28 @@ const detect = async source => {
|
|
|
34024
34031
|
* @public
|
|
34025
34032
|
*/
|
|
34026
34033
|
const parse = async source => {
|
|
34027
|
-
const
|
|
34028
|
-
|
|
34029
|
-
|
|
34034
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
|
|
34035
|
+
if (source.trim().length === 0) {
|
|
34036
|
+
return parseResult;
|
|
34037
|
+
}
|
|
34038
|
+
const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
|
|
34039
|
+
version: '1.2'
|
|
34040
|
+
});
|
|
34041
|
+
|
|
34042
|
+
// Handle document errors
|
|
34043
|
+
for (const error of document.errors) {
|
|
34044
|
+
if (error.code === 'MULTIPLE_DOCS') {
|
|
34045
|
+
// Multiple documents warning (align with tree-sitter behavior)
|
|
34046
|
+
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
34047
|
+
const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](message);
|
|
34048
|
+
annotation.classes.push('warning');
|
|
34049
|
+
parseResult.push(annotation);
|
|
34050
|
+
} else {
|
|
34051
|
+
// Fatal error - throw
|
|
34052
|
+
throw error;
|
|
34053
|
+
}
|
|
34054
|
+
}
|
|
34055
|
+
const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(document.toJS());
|
|
34030
34056
|
element.classes.push('result');
|
|
34031
34057
|
parseResult.push(element);
|
|
34032
34058
|
return parseResult;
|
|
@@ -41225,7 +41251,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41225
41251
|
/* harmony export */ syntacticAnalysis: () => (/* reexport safe */ _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])
|
|
41226
41252
|
/* harmony export */ });
|
|
41227
41253
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
|
|
41228
|
-
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
41254
|
+
/* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
|
|
41229
41255
|
/* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
|
|
41230
41256
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
|
|
41231
41257
|
/* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47657);
|
|
@@ -41265,10 +41291,6 @@ const detect = async (source, {
|
|
|
41265
41291
|
* @public
|
|
41266
41292
|
*/
|
|
41267
41293
|
|
|
41268
|
-
/**
|
|
41269
|
-
* @public
|
|
41270
|
-
*/
|
|
41271
|
-
|
|
41272
41294
|
/**
|
|
41273
41295
|
* @public
|
|
41274
41296
|
*/
|
|
@@ -45361,7 +45383,11 @@ const detectionRegExp = /(?<YAML>^(["']?)swagger\2\s*:\s*(["'])(?<version_yaml>2
|
|
|
45361
45383
|
/**
|
|
45362
45384
|
* @public
|
|
45363
45385
|
*/
|
|
45364
|
-
const detect = async source => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source));
|
|
45386
|
+
const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source, options));
|
|
45387
|
+
|
|
45388
|
+
/**
|
|
45389
|
+
* @public
|
|
45390
|
+
*/
|
|
45365
45391
|
|
|
45366
45392
|
/**
|
|
45367
45393
|
* @public
|