@speclynx/apidom-parser-adapter-openapi-yaml-3-0 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 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-3-0
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-3-0
@@ -35911,7 +35911,8 @@ __webpack_require__.r(__webpack_exports__);
35911
35911
  /* harmony export */ });
35912
35912
  /* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53291);
35913
35913
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10404);
35914
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4823);
35914
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84660);
35915
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
35915
35916
 
35916
35917
 
35917
35918
 
@@ -35919,9 +35920,15 @@ __webpack_require__.r(__webpack_exports__);
35919
35920
  * @public
35920
35921
  */
35921
35922
  const detect = async source => {
35923
+ if (source.trim().length === 0) {
35924
+ return false;
35925
+ }
35922
35926
  try {
35923
- (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
35924
- return true;
35927
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
35928
+ version: '1.2'
35929
+ });
35930
+ // Filter out MULTIPLE_DOCS errors (handled as warning in parse)
35931
+ return document.errors.filter(e => e.code !== 'MULTIPLE_DOCS').length === 0;
35925
35932
  } catch {
35926
35933
  return false;
35927
35934
  }
@@ -35931,9 +35938,28 @@ const detect = async source => {
35931
35938
  * @public
35932
35939
  */
35933
35940
  const parse = async source => {
35934
- const pojo = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
35935
- const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(pojo);
35936
- const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
35941
+ const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
35942
+ if (source.trim().length === 0) {
35943
+ return parseResult;
35944
+ }
35945
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
35946
+ version: '1.2'
35947
+ });
35948
+
35949
+ // Handle document errors
35950
+ for (const error of document.errors) {
35951
+ if (error.code === 'MULTIPLE_DOCS') {
35952
+ // Multiple documents warning (align with tree-sitter behavior)
35953
+ const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
35954
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](message);
35955
+ annotation.classes.push('warning');
35956
+ parseResult.push(annotation);
35957
+ } else {
35958
+ // Fatal error - throw
35959
+ throw error;
35960
+ }
35961
+ }
35962
+ const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(document.toJS());
35937
35963
  element.classes.push('result');
35938
35964
  parseResult.push(element);
35939
35965
  return parseResult;
@@ -43147,7 +43173,7 @@ __webpack_require__.r(__webpack_exports__);
43147
43173
  /* harmony export */ syntacticAnalysis: () => (/* reexport safe */ _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])
43148
43174
  /* harmony export */ });
43149
43175
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
43150
- /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16126);
43176
+ /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
43151
43177
  /* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
43152
43178
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
43153
43179
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47657);
@@ -43187,10 +43213,6 @@ const detect = async (source, {
43187
43213
  * @public
43188
43214
  */
43189
43215
 
43190
- /**
43191
- * @public
43192
- */
43193
-
43194
43216
  /**
43195
43217
  * @public
43196
43218
  */
@@ -47658,7 +47680,11 @@ const detectionRegExp = /(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>
47658
47680
  /**
47659
47681
  * @public
47660
47682
  */
47661
- const detect = async source => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source));
47683
+ const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source, options));
47684
+
47685
+ /**
47686
+ * @public
47687
+ */
47662
47688
 
47663
47689
  /**
47664
47690
  * @public