@speclynx/apidom-parser-adapter-openapi-yaml-3-1 2.2.3 → 2.3.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,12 @@
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.3.0](https://github.com/speclynx/apidom/compare/v2.2.3...v2.3.0) (2026-01-27)
7
+
8
+ ### Features
9
+
10
+ - 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)
11
+
6
12
  ## [2.2.3](https://github.com/speclynx/apidom/compare/v2.2.2...v2.2.3) (2026-01-26)
7
13
 
8
14
  **Note:** Version bump only for package @speclynx/apidom-parser-adapter-openapi-yaml-3-1
@@ -39957,7 +39957,8 @@ __webpack_require__.r(__webpack_exports__);
39957
39957
  /* harmony export */ });
39958
39958
  /* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(53291);
39959
39959
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10404);
39960
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4823);
39960
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84660);
39961
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4823);
39961
39962
 
39962
39963
 
39963
39964
 
@@ -39965,9 +39966,15 @@ __webpack_require__.r(__webpack_exports__);
39965
39966
  * @public
39966
39967
  */
39967
39968
  const detect = async source => {
39969
+ if (source.trim().length === 0) {
39970
+ return false;
39971
+ }
39968
39972
  try {
39969
- (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
39970
- return true;
39973
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
39974
+ version: '1.2'
39975
+ });
39976
+ // Filter out MULTIPLE_DOCS errors (handled as warning in parse)
39977
+ return document.errors.filter(e => e.code !== 'MULTIPLE_DOCS').length === 0;
39971
39978
  } catch {
39972
39979
  return false;
39973
39980
  }
@@ -39977,9 +39984,28 @@ const detect = async source => {
39977
39984
  * @public
39978
39985
  */
39979
39986
  const parse = async source => {
39980
- const pojo = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parse)(source);
39981
- const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(pojo);
39982
- const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
39987
+ const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]();
39988
+ if (source.trim().length === 0) {
39989
+ return parseResult;
39990
+ }
39991
+ const document = (0,yaml__WEBPACK_IMPORTED_MODULE_0__.parseDocument)(source, {
39992
+ version: '1.2'
39993
+ });
39994
+
39995
+ // Handle document errors
39996
+ for (const error of document.errors) {
39997
+ if (error.code === 'MULTIPLE_DOCS') {
39998
+ // Multiple documents warning (align with tree-sitter behavior)
39999
+ const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
40000
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"](message);
40001
+ annotation.classes.push('warning');
40002
+ parseResult.push(annotation);
40003
+ } else {
40004
+ // Fatal error - throw
40005
+ throw error;
40006
+ }
40007
+ }
40008
+ const element = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.refract)(document.toJS());
39983
40009
  element.classes.push('result');
39984
40010
  parseResult.push(element);
39985
40011
  return parseResult;
@@ -48498,7 +48524,7 @@ __webpack_require__.r(__webpack_exports__);
48498
48524
  /* harmony export */ syntacticAnalysis: () => (/* reexport safe */ _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"])
48499
48525
  /* harmony export */ });
48500
48526
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55156);
48501
- /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16126);
48527
+ /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20746);
48502
48528
  /* harmony import */ var _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69124);
48503
48529
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10405);
48504
48530
  /* harmony import */ var _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47657);
@@ -48538,10 +48564,6 @@ const detect = async (source, {
48538
48564
  * @public
48539
48565
  */
48540
48566
 
48541
- /**
48542
- * @public
48543
- */
48544
-
48545
48567
  /**
48546
48568
  * @public
48547
48569
  */
@@ -53220,7 +53242,11 @@ const detectionRegExp = /(?<YAML>^(["']?)openapi\2\s*:\s*(["']?)(?<version_yaml>
53220
53242
  /**
53221
53243
  * @public
53222
53244
  */
53223
- const detect = async source => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source));
53245
+ const detect = async (source, options = {}) => detectionRegExp.test(source) && (await (0,_speclynx_apidom_parser_adapter_yaml_1_2__WEBPACK_IMPORTED_MODULE_4__.detect)(source, options));
53246
+
53247
+ /**
53248
+ * @public
53249
+ */
53224
53250
 
53225
53251
  /**
53226
53252
  * @public