swagger-client 3.37.2 → 3.37.4

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.
Files changed (67) hide show
  1. package/README.md +2 -5
  2. package/dist/swagger-client.browser.js +2044 -1806
  3. package/dist/swagger-client.browser.min.js +1 -1
  4. package/dist/swagger-client.browser.min.js.map +1 -1
  5. package/es/execute/index.js +7 -6
  6. package/es/execute/oas3/build-request.js +3 -6
  7. package/es/execute/oas3/content-serializer.js +2 -1
  8. package/es/execute/oas3/parameter-builders.js +2 -3
  9. package/es/execute/oas3/style-serializer.js +1 -1
  10. package/es/http/index.js +0 -1
  11. package/es/http/serializers/response/index.js +2 -1
  12. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js +1 -2
  13. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js +2 -4
  14. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +27 -33
  15. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js +1 -2
  16. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js +1 -2
  17. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/index.js +1 -2
  18. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/all-of.js +2 -4
  19. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/dereference.js +27 -33
  20. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/parameters.js +1 -2
  21. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/properties.js +1 -2
  22. package/es/resolver/apidom/reference/parse/parsers/json/index.js +4 -2
  23. package/es/resolver/apidom/reference/parse/parsers/openapi-json-3-1/index.js +4 -2
  24. package/es/resolver/apidom/reference/parse/parsers/openapi-json-3-2/index.js +4 -2
  25. package/es/resolver/apidom/reference/parse/parsers/openapi-yaml-3-1/index.js +4 -2
  26. package/es/resolver/apidom/reference/parse/parsers/openapi-yaml-3-2/index.js +4 -2
  27. package/es/resolver/apidom/reference/parse/parsers/yaml-1-2/index.js +4 -2
  28. package/es/resolver/apidom/reference/resolve/resolvers/http-swagger-client/index.js +0 -1
  29. package/es/resolver/specmap/helpers.js +4 -3
  30. package/es/resolver/specmap/lib/refs.js +0 -1
  31. package/es/resolver/strategies/generic/normalize.js +5 -2
  32. package/es/resolver/utils/options.js +2 -3
  33. package/es/subtree-resolver/index.js +1 -1
  34. package/lib/execute/index.js +7 -6
  35. package/lib/execute/oas3/build-request.js +3 -6
  36. package/lib/execute/oas3/content-serializer.js +3 -1
  37. package/lib/execute/oas3/parameter-builders.js +2 -3
  38. package/lib/execute/oas3/style-serializer.js +1 -1
  39. package/lib/http/index.js +0 -1
  40. package/lib/http/serializers/response/index.js +2 -1
  41. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js +1 -2
  42. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js +2 -4
  43. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +27 -33
  44. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js +1 -2
  45. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js +1 -2
  46. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/index.js +1 -2
  47. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/all-of.js +2 -4
  48. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/dereference.js +27 -33
  49. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/parameters.js +1 -2
  50. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-2-swagger-client/visitors/properties.js +1 -2
  51. package/lib/resolver/apidom/reference/parse/parsers/json/index.js +5 -2
  52. package/lib/resolver/apidom/reference/parse/parsers/openapi-json-3-1/index.js +5 -2
  53. package/lib/resolver/apidom/reference/parse/parsers/openapi-json-3-2/index.js +5 -2
  54. package/lib/resolver/apidom/reference/parse/parsers/openapi-yaml-3-1/index.js +5 -2
  55. package/lib/resolver/apidom/reference/parse/parsers/openapi-yaml-3-2/index.js +5 -2
  56. package/lib/resolver/apidom/reference/parse/parsers/yaml-1-2/index.js +5 -2
  57. package/lib/resolver/apidom/reference/resolve/resolvers/http-swagger-client/index.js +0 -1
  58. package/lib/resolver/specmap/helpers.js +4 -3
  59. package/lib/resolver/specmap/lib/refs.js +0 -1
  60. package/lib/resolver/strategies/generic/normalize.js +5 -2
  61. package/lib/resolver/utils/options.js +2 -3
  62. package/lib/subtree-resolver/index.js +1 -1
  63. package/package.json +15 -16
  64. package/es/helpers/fetch-polyfill.node.js +0 -22
  65. package/es/helpers/fetch-ponyfill-node-fetch.node.js +0 -3
  66. package/lib/helpers/fetch-polyfill.node.js +0 -24
  67. package/lib/helpers/fetch-ponyfill-node-fetch.node.js +0 -12
@@ -5,6 +5,7 @@ exports.__esModule = true;
5
5
  exports.serializeHeaders = serializeHeaders;
6
6
  exports.serializeResponse = serializeResponse;
7
7
  exports.shouldDownloadAsText = void 0;
8
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
8
9
  var _jsYaml = _interopRequireDefault(require("js-yaml"));
9
10
  const shouldDownloadAsText = (contentType = '') => /(json|xml|yaml|text)\b/.test(contentType);
10
11
  exports.shouldDownloadAsText = shouldDownloadAsText;
@@ -20,7 +21,7 @@ function parseBody(body, contentType) {
20
21
  return _jsYaml.default.load(body);
21
22
  }
22
23
  function serializeHeaderValue(value) {
23
- const isMulti = value.includes(', ');
24
+ const isMulti = (0, _includes.default)(value).call(value, ', ');
24
25
  return isMulti ? value.split(', ') : value;
25
26
  }
26
27
 
@@ -37,9 +37,8 @@ class OpenAPI3_1SwaggerClientDereferenceStrategy extends _openapi.default {
37
37
  this.ancestors = [...ancestors];
38
38
  }
39
39
  async dereference(file, options) {
40
- var _options$dereference$;
41
40
  const namespace = (0, _apidomCore.createNamespace)(_apidomNsOpenapi.default);
42
- const immutableRefSet = (_options$dereference$ = options.dereference.refSet) != null ? _options$dereference$ : new _empty.ReferenceSet();
41
+ const immutableRefSet = options.dereference.refSet ?? new _empty.ReferenceSet();
43
42
  const mutableRefsSet = new _empty.ReferenceSet();
44
43
  let refSet = immutableRefSet;
45
44
  let reference;
@@ -16,10 +16,9 @@ class AllOfVisitor {
16
16
 
17
17
  // collect error and return if allOf keyword is not an array
18
18
  if (!(0, _apidomCore.isArrayElement)(schemaElement.allOf)) {
19
- var _this$options$derefer;
20
19
  const error = new TypeError('allOf must be an array');
21
20
  error.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'allOf'];
22
- (_this$options$derefer = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer = _this$options$derefer.errors) == null || _this$options$derefer.push == null || _this$options$derefer.push(error);
21
+ this.options.dereference.dereferenceOpts?.errors?.push?.(error);
23
22
  return undefined;
24
23
  }
25
24
 
@@ -32,10 +31,9 @@ class AllOfVisitor {
32
31
  // collect errors if allOf keyword contains anything else than Schema Object
33
32
  const includesSchemaElementOnly = schemaElement.allOf.content.every(_apidomNsOpenapi.isSchemaElement);
34
33
  if (!includesSchemaElementOnly) {
35
- var _this$options$derefer2;
36
34
  const error = new TypeError('Elements in allOf must be objects');
37
35
  error.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'allOf'];
38
- (_this$options$derefer2 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer2 = _this$options$derefer2.errors) == null || _this$options$derefer2.push == null || _this$options$derefer2.push(error);
36
+ this.options.dereference.dereferenceOpts?.errors?.push?.(error);
39
37
  return undefined;
40
38
  }
41
39
  while (schemaElement.hasKey('allOf')) {
@@ -3,6 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
4
  exports.__esModule = true;
5
5
  exports.default = void 0;
6
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
6
7
  var _apidomCore = require("@swagger-api/apidom-core");
7
8
  var _apidomError = require("@swagger-api/apidom-error");
8
9
  var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-1");
@@ -50,8 +51,9 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
50
51
  }
51
52
  async ReferenceElement(referencingElement, key, parent, path, ancestors, link) {
52
53
  try {
54
+ var _context, _context2;
53
55
  // skip current referencing element as it's already been access
54
- if (this.indirections.includes(referencingElement)) {
56
+ if ((0, _includes.default)(_context = this.indirections).call(_context, referencingElement)) {
55
57
  return false;
56
58
  }
57
59
  const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
@@ -106,12 +108,11 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
106
108
  }
107
109
 
108
110
  // detect second deep dive into the same fragment and avoid it
109
- if (ancestorsLineage.includes(referencedElement)) {
111
+ if ((0, _includes.default)(ancestorsLineage).call(ancestorsLineage, referencedElement)) {
110
112
  reference.refSet.circular = true;
111
113
  if (this.options.dereference.circular === 'error') {
112
114
  throw new _apidomError.ApiDOMError('Circular reference detected');
113
115
  } else if (this.options.dereference.circular === 'replace') {
114
- var _this$options$derefer, _this$options$derefer2;
115
116
  const refElement = new _apidomCore.RefElement(referencedElement.id, {
116
117
  type: 'reference',
117
118
  uri: reference.uri,
@@ -119,7 +120,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
119
120
  baseURI: $refBaseURI,
120
121
  referencingElement
121
122
  });
122
- const replacer = (_this$options$derefer = (_this$options$derefer2 = this.options.dereference.strategyOpts['openapi-3-1']) == null ? void 0 : _this$options$derefer2.circularReplacer) != null ? _this$options$derefer : this.options.dereference.circularReplacer;
123
+ const replacer = this.options.dereference.strategyOpts['openapi-3-1']?.circularReplacer ?? this.options.dereference.circularReplacer;
123
124
  const replacement = replacer(refElement);
124
125
  link.replaceWith(refElement, mutationReplacer);
125
126
  return !parent ? replacement : false;
@@ -136,9 +137,8 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
136
137
  * 4. We are dereferencing the fragment lazily/eagerly depending on circular mode
137
138
  */
138
139
  const isNonRootDocument = _empty.url.stripHash(reference.refSet.rootRef.uri) !== reference.uri;
139
- const shouldDetectCircular = ['error', 'replace'].includes(this.options.dereference.circular);
140
+ const shouldDetectCircular = (0, _includes.default)(_context2 = ['error', 'replace']).call(_context2, this.options.dereference.circular);
140
141
  if ((isExternalReference || isNonRootDocument || (0, _apidomNsOpenapi.isReferenceElement)(referencedElement) || shouldDetectCircular) && !ancestorsLineage.includesCycle(referencedElement)) {
141
- var _this$basePath;
142
142
  // append referencing reference to ancestors lineage
143
143
  directAncestors.add(referencingElement);
144
144
  const visitor = new OpenAPI3_1SwaggerClientDereferenceVisitor({
@@ -150,7 +150,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
150
150
  ancestors: ancestorsLineage,
151
151
  allowMetaPatches: this.allowMetaPatches,
152
152
  useCircularStructures: this.useCircularStructures,
153
- basePath: (_this$basePath = this.basePath) != null ? _this$basePath : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
153
+ basePath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
154
154
  });
155
155
  referencedElement = await visitAsync(referencedElement, visitor, {
156
156
  keyMap: _apidomNsOpenapi.keyMap,
@@ -205,27 +205,27 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
205
205
  */
206
206
  return !parent ? mergedElement : false;
207
207
  } catch (error) {
208
- var _this$basePath2, _this$options$derefer3;
209
208
  const rootCause = (0, _getRootCause.default)(error);
210
209
  const wrappedError = wrapError(rootCause, {
211
210
  baseDoc: this.reference.uri,
212
211
  $ref: (0, _apidomCore.toValue)(referencingElement.$ref),
213
212
  pointer: _modern.URIFragmentIdentifier.fromURIReference((0, _apidomCore.toValue)(referencingElement.$ref)),
214
- fullPath: (_this$basePath2 = this.basePath) != null ? _this$basePath2 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
213
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
215
214
  });
216
- (_this$options$derefer3 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer3 = _this$options$derefer3.errors) == null || _this$options$derefer3.push == null || _this$options$derefer3.push(wrappedError);
215
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
217
216
  return undefined;
218
217
  }
219
218
  }
220
219
  async PathItemElement(pathItemElement, key, parent, path, ancestors, link) {
221
220
  try {
221
+ var _context3, _context4;
222
222
  // ignore PathItemElement without $ref field
223
223
  if (!(0, _apidomCore.isStringElement)(pathItemElement.$ref)) {
224
224
  return undefined;
225
225
  }
226
226
 
227
227
  // skip current referencing element as it's already been access
228
- if (this.indirections.includes(pathItemElement)) {
228
+ if ((0, _includes.default)(_context3 = this.indirections).call(_context3, pathItemElement)) {
229
229
  return false;
230
230
  }
231
231
 
@@ -277,12 +277,11 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
277
277
  }
278
278
 
279
279
  // detect second deep dive into the same fragment and avoid it
280
- if (ancestorsLineage.includes(referencedElement)) {
280
+ if ((0, _includes.default)(ancestorsLineage).call(ancestorsLineage, referencedElement)) {
281
281
  reference.refSet.circular = true;
282
282
  if (this.options.dereference.circular === 'error') {
283
283
  throw new _apidomError.ApiDOMError('Circular reference detected');
284
284
  } else if (this.options.dereference.circular === 'replace') {
285
- var _this$options$derefer4, _this$options$derefer5;
286
285
  const refElement = new _apidomCore.RefElement(referencedElement.id, {
287
286
  type: 'path-item',
288
287
  uri: reference.uri,
@@ -290,7 +289,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
290
289
  baseURI: $refBaseURI,
291
290
  referencingElement: pathItemElement
292
291
  });
293
- const replacer = (_this$options$derefer4 = (_this$options$derefer5 = this.options.dereference.strategyOpts['openapi-3-1']) == null ? void 0 : _this$options$derefer5.circularReplacer) != null ? _this$options$derefer4 : this.options.dereference.circularReplacer;
292
+ const replacer = this.options.dereference.strategyOpts['openapi-3-1']?.circularReplacer ?? this.options.dereference.circularReplacer;
294
293
  const replacement = replacer(refElement);
295
294
  link.replaceWith(refElement, mutationReplacer);
296
295
  return !parent ? replacement : false;
@@ -307,9 +306,8 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
307
306
  * 4. We are dereferencing the fragment lazily/eagerly depending on circular mode
308
307
  */
309
308
  const isNonRootDocument = _empty.url.stripHash(reference.refSet.rootRef.uri) !== reference.uri;
310
- const shouldDetectCircular = ['error', 'replace'].includes(this.options.dereference.circular);
309
+ const shouldDetectCircular = (0, _includes.default)(_context4 = ['error', 'replace']).call(_context4, this.options.dereference.circular);
311
310
  if ((isExternalReference || isNonRootDocument || (0, _apidomNsOpenapi.isPathItemElement)(referencedElement) && (0, _apidomCore.isStringElement)(referencedElement.$ref) || shouldDetectCircular) && !ancestorsLineage.includesCycle(referencedElement)) {
312
- var _this$basePath3;
313
311
  // append referencing schema to ancestors lineage
314
312
  directAncestors.add(pathItemElement);
315
313
 
@@ -322,7 +320,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
322
320
  ancestors: ancestorsLineage,
323
321
  allowMetaPatches: this.allowMetaPatches,
324
322
  useCircularStructures: this.useCircularStructures,
325
- basePath: (_this$basePath3 = this.basePath) != null ? _this$basePath3 : [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
323
+ basePath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
326
324
  });
327
325
  referencedElement = await visitAsync(referencedElement, visitor, {
328
326
  keyMap: _apidomNsOpenapi.keyMap,
@@ -376,20 +374,20 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
376
374
  */
377
375
  return !parent ? referencedElement : undefined;
378
376
  } catch (error) {
379
- var _this$basePath4, _this$options$derefer6;
380
377
  const rootCause = (0, _getRootCause.default)(error);
381
378
  const wrappedError = wrapError(rootCause, {
382
379
  baseDoc: this.reference.uri,
383
380
  $ref: (0, _apidomCore.toValue)(pathItemElement.$ref),
384
381
  pointer: _modern.URIFragmentIdentifier.fromURIReference((0, _apidomCore.toValue)(pathItemElement.$ref)),
385
- fullPath: (_this$basePath4 = this.basePath) != null ? _this$basePath4 : [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
382
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
386
383
  });
387
- (_this$options$derefer6 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer6 = _this$options$derefer6.errors) == null || _this$options$derefer6.push == null || _this$options$derefer6.push(wrappedError);
384
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
388
385
  return undefined;
389
386
  }
390
387
  }
391
388
  async SchemaElement(referencingElement, key, parent, path, ancestors, link) {
392
389
  try {
390
+ var _context5, _context6;
393
391
  // skip current referencing schema as $ref keyword was not defined
394
392
  if (!(0, _apidomCore.isStringElement)(referencingElement.$ref)) {
395
393
  // skip traversing this schema but traverse all it's child schemas
@@ -397,7 +395,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
397
395
  }
398
396
 
399
397
  // skip current referencing element as it's already been access
400
- if (this.indirections.includes(referencingElement)) {
398
+ if ((0, _includes.default)(_context5 = this.indirections).call(_context5, referencingElement)) {
401
399
  return false;
402
400
  }
403
401
  const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
@@ -529,12 +527,11 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
529
527
  }
530
528
 
531
529
  // detect second deep dive into the same fragment and avoid it
532
- if (ancestorsLineage.includes(referencedElement)) {
530
+ if ((0, _includes.default)(ancestorsLineage).call(ancestorsLineage, referencedElement)) {
533
531
  reference.refSet.circular = true;
534
532
  if (this.options.dereference.circular === 'error') {
535
533
  throw new _apidomError.ApiDOMError('Circular reference detected');
536
534
  } else if (this.options.dereference.circular === 'replace') {
537
- var _this$options$derefer7, _this$options$derefer8;
538
535
  const refElement = new _apidomCore.RefElement(referencedElement.id, {
539
536
  type: 'json-schema',
540
537
  uri: reference.uri,
@@ -542,7 +539,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
542
539
  baseURI: _empty.url.resolve(retrievalURI, $refBaseURI),
543
540
  referencingElement
544
541
  });
545
- const replacer = (_this$options$derefer7 = (_this$options$derefer8 = this.options.dereference.strategyOpts['openapi-3-1']) == null ? void 0 : _this$options$derefer8.circularReplacer) != null ? _this$options$derefer7 : this.options.dereference.circularReplacer;
542
+ const replacer = this.options.dereference.strategyOpts['openapi-3-1']?.circularReplacer ?? this.options.dereference.circularReplacer;
546
543
  const replacement = replacer(refElement);
547
544
  link.replaceWith(replacement, mutationReplacer);
548
545
  return !parent ? replacement : false;
@@ -559,9 +556,8 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
559
556
  * 4. We are dereferencing the fragment lazily/eagerly depending on circular mode
560
557
  */
561
558
  const isNonRootDocument = _empty.url.stripHash(reference.refSet.rootRef.uri) !== reference.uri;
562
- const shouldDetectCircular = ['error', 'replace'].includes(this.options.dereference.circular);
559
+ const shouldDetectCircular = (0, _includes.default)(_context6 = ['error', 'replace']).call(_context6, this.options.dereference.circular);
563
560
  if ((isExternalReference || isNonRootDocument || (0, _apidomNsOpenapi.isSchemaElement)(referencedElement) && (0, _apidomCore.isStringElement)(referencedElement.$ref) || shouldDetectCircular) && !ancestorsLineage.includesCycle(referencedElement)) {
564
- var _this$basePath5;
565
561
  // append referencing schema to ancestors lineage
566
562
  directAncestors.add(referencingElement);
567
563
 
@@ -574,7 +570,7 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
574
570
  useCircularStructures: this.useCircularStructures,
575
571
  allowMetaPatches: this.allowMetaPatches,
576
572
  ancestors: ancestorsLineage,
577
- basePath: (_this$basePath5 = this.basePath) != null ? _this$basePath5 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
573
+ basePath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
578
574
  });
579
575
  referencedElement = await visitAsync(referencedElement, mergeVisitor, {
580
576
  keyMap: _apidomNsOpenapi.keyMap,
@@ -641,15 +637,14 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
641
637
  */
642
638
  return !parent ? referencedElement : undefined;
643
639
  } catch (error) {
644
- var _this$basePath6, _this$options$derefer9;
645
640
  const rootCause = (0, _getRootCause.default)(error);
646
641
  const wrappedError = new _SchemaRefError.default(`Could not resolve reference: ${rootCause.message}`, {
647
642
  baseDoc: this.reference.uri,
648
643
  $ref: (0, _apidomCore.toValue)(referencingElement.$ref),
649
- fullPath: (_this$basePath6 = this.basePath) != null ? _this$basePath6 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref'],
644
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref'],
650
645
  cause: rootCause
651
646
  });
652
- (_this$options$derefer9 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer9 = _this$options$derefer9.errors) == null || _this$options$derefer9.push == null || _this$options$derefer9.push(wrappedError);
647
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
653
648
  return undefined;
654
649
  }
655
650
  }
@@ -667,14 +662,13 @@ class OpenAPI3_1SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_1Deref
667
662
  try {
668
663
  return await super.ExampleElement(exampleElement, key, parent, path, ancestors, link);
669
664
  } catch (error) {
670
- var _this$basePath7, _this$options$derefer0;
671
665
  const rootCause = (0, _getRootCause.default)(error);
672
666
  const wrappedError = wrapError(rootCause, {
673
667
  baseDoc: this.reference.uri,
674
668
  externalValue: (0, _apidomCore.toValue)(exampleElement.externalValue),
675
- fullPath: (_this$basePath7 = this.basePath) != null ? _this$basePath7 : [...(0, _toPath.default)([...ancestors, parent, exampleElement]), 'externalValue']
669
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, exampleElement]), 'externalValue']
676
670
  });
677
- (_this$options$derefer0 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer0 = _this$options$derefer0.errors) == null || _this$options$derefer0.push == null || _this$options$derefer0.push(wrappedError);
671
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
678
672
  return undefined;
679
673
  }
680
674
  }
@@ -25,12 +25,11 @@ class ParameterMacroVisitor {
25
25
  const macroValue = this.parameterMacro(pojoOperation, pojoParameter);
26
26
  parameterElement.set('default', macroValue);
27
27
  } catch (error) {
28
- var _this$options$derefer;
29
28
  const macroError = new Error(error, {
30
29
  cause: error
31
30
  });
32
31
  macroError.fullPath = (0, _toPath.default)([...ancestors, parent]);
33
- (_this$options$derefer = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer = _this$options$derefer.errors) == null || _this$options$derefer.push == null || _this$options$derefer.push(macroError);
32
+ this.options.dereference.dereferenceOpts?.errors?.push?.(macroError);
34
33
  }
35
34
  }
36
35
  };
@@ -18,12 +18,11 @@ class ModelPropertyMacroVisitor {
18
18
  const macroValue = this.modelPropertyMacro((0, _apidomCore.toValue)(property));
19
19
  property.set('default', macroValue);
20
20
  } catch (error) {
21
- var _this$options$derefer;
22
21
  const macroError = new Error(error, {
23
22
  cause: error
24
23
  });
25
24
  macroError.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'properties'];
26
- (_this$options$derefer = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer = _this$options$derefer.errors) == null || _this$options$derefer.push == null || _this$options$derefer.push(macroError);
25
+ this.options.dereference.dereferenceOpts?.errors?.push?.(macroError);
27
26
  }
28
27
  });
29
28
  }
@@ -37,9 +37,8 @@ class OpenAPI3_2SwaggerClientDereferenceStrategy extends _openapi.default {
37
37
  this.ancestors = [...ancestors];
38
38
  }
39
39
  async dereference(file, options) {
40
- var _options$dereference$;
41
40
  const namespace = (0, _apidomCore.createNamespace)(_apidomNsOpenapi.default);
42
- const immutableRefSet = (_options$dereference$ = options.dereference.refSet) != null ? _options$dereference$ : new _empty.ReferenceSet();
41
+ const immutableRefSet = options.dereference.refSet ?? new _empty.ReferenceSet();
43
42
  const mutableRefsSet = new _empty.ReferenceSet();
44
43
  let refSet = immutableRefSet;
45
44
  let reference;
@@ -16,10 +16,9 @@ class AllOfVisitor {
16
16
 
17
17
  // collect error and return if allOf keyword is not an array
18
18
  if (!(0, _apidomCore.isArrayElement)(schemaElement.allOf)) {
19
- var _this$options$derefer;
20
19
  const error = new TypeError('allOf must be an array');
21
20
  error.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'allOf'];
22
- (_this$options$derefer = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer = _this$options$derefer.errors) == null || _this$options$derefer.push == null || _this$options$derefer.push(error);
21
+ this.options.dereference.dereferenceOpts?.errors?.push?.(error);
23
22
  return undefined;
24
23
  }
25
24
 
@@ -32,10 +31,9 @@ class AllOfVisitor {
32
31
  // collect errors if allOf keyword contains anything else than Schema Object
33
32
  const includesSchemaElementOnly = schemaElement.allOf.content.every(_apidomNsOpenapi.isSchemaElement);
34
33
  if (!includesSchemaElementOnly) {
35
- var _this$options$derefer2;
36
34
  const error = new TypeError('Elements in allOf must be objects');
37
35
  error.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'allOf'];
38
- (_this$options$derefer2 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer2 = _this$options$derefer2.errors) == null || _this$options$derefer2.push == null || _this$options$derefer2.push(error);
36
+ this.options.dereference.dereferenceOpts?.errors?.push?.(error);
39
37
  return undefined;
40
38
  }
41
39
  while (schemaElement.hasKey('allOf')) {
@@ -3,6 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
4
  exports.__esModule = true;
5
5
  exports.default = void 0;
6
+ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
6
7
  var _apidomCore = require("@swagger-api/apidom-core");
7
8
  var _apidomError = require("@swagger-api/apidom-error");
8
9
  var _apidomNsOpenapi = require("@swagger-api/apidom-ns-openapi-3-2");
@@ -50,8 +51,9 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
50
51
  }
51
52
  async ReferenceElement(referencingElement, key, parent, path, ancestors, link) {
52
53
  try {
54
+ var _context, _context2;
53
55
  // skip current referencing element as it's already been access
54
- if (this.indirections.includes(referencingElement)) {
56
+ if ((0, _includes.default)(_context = this.indirections).call(_context, referencingElement)) {
55
57
  return false;
56
58
  }
57
59
  const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
@@ -106,12 +108,11 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
106
108
  }
107
109
 
108
110
  // detect second deep dive into the same fragment and avoid it
109
- if (ancestorsLineage.includes(referencedElement)) {
111
+ if ((0, _includes.default)(ancestorsLineage).call(ancestorsLineage, referencedElement)) {
110
112
  reference.refSet.circular = true;
111
113
  if (this.options.dereference.circular === 'error') {
112
114
  throw new _apidomError.ApiDOMError('Circular reference detected');
113
115
  } else if (this.options.dereference.circular === 'replace') {
114
- var _this$options$derefer, _this$options$derefer2;
115
116
  const refElement = new _apidomCore.RefElement(referencedElement.id, {
116
117
  type: 'reference',
117
118
  uri: reference.uri,
@@ -119,7 +120,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
119
120
  baseURI: $refBaseURI,
120
121
  referencingElement
121
122
  });
122
- const replacer = (_this$options$derefer = (_this$options$derefer2 = this.options.dereference.strategyOpts['openapi-3-2']) == null ? void 0 : _this$options$derefer2.circularReplacer) != null ? _this$options$derefer : this.options.dereference.circularReplacer;
123
+ const replacer = this.options.dereference.strategyOpts['openapi-3-2']?.circularReplacer ?? this.options.dereference.circularReplacer;
123
124
  const replacement = replacer(refElement);
124
125
  link.replaceWith(refElement, mutationReplacer);
125
126
  return !parent ? replacement : false;
@@ -136,9 +137,8 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
136
137
  * 4. We are dereferencing the fragment lazily/eagerly depending on circular mode
137
138
  */
138
139
  const isNonRootDocument = _empty.url.stripHash(reference.refSet.rootRef.uri) !== reference.uri;
139
- const shouldDetectCircular = ['error', 'replace'].includes(this.options.dereference.circular);
140
+ const shouldDetectCircular = (0, _includes.default)(_context2 = ['error', 'replace']).call(_context2, this.options.dereference.circular);
140
141
  if ((isExternalReference || isNonRootDocument || (0, _apidomNsOpenapi.isReferenceElement)(referencedElement) || shouldDetectCircular) && !ancestorsLineage.includesCycle(referencedElement)) {
141
- var _this$basePath;
142
142
  // append referencing reference to ancestors lineage
143
143
  directAncestors.add(referencingElement);
144
144
  const visitor = new OpenAPI3_2SwaggerClientDereferenceVisitor({
@@ -150,7 +150,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
150
150
  ancestors: ancestorsLineage,
151
151
  allowMetaPatches: this.allowMetaPatches,
152
152
  useCircularStructures: this.useCircularStructures,
153
- basePath: (_this$basePath = this.basePath) != null ? _this$basePath : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
153
+ basePath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
154
154
  });
155
155
  referencedElement = await visitAsync(referencedElement, visitor, {
156
156
  keyMap: _apidomNsOpenapi.keyMap,
@@ -205,27 +205,27 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
205
205
  */
206
206
  return !parent ? mergedElement : false;
207
207
  } catch (error) {
208
- var _this$basePath2, _this$options$derefer3;
209
208
  const rootCause = (0, _getRootCause.default)(error);
210
209
  const wrappedError = wrapError(rootCause, {
211
210
  baseDoc: this.reference.uri,
212
211
  $ref: (0, _apidomCore.toValue)(referencingElement.$ref),
213
212
  pointer: _modern.URIFragmentIdentifier.fromURIReference((0, _apidomCore.toValue)(referencingElement.$ref)),
214
- fullPath: (_this$basePath2 = this.basePath) != null ? _this$basePath2 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
213
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
215
214
  });
216
- (_this$options$derefer3 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer3 = _this$options$derefer3.errors) == null || _this$options$derefer3.push == null || _this$options$derefer3.push(wrappedError);
215
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
217
216
  return undefined;
218
217
  }
219
218
  }
220
219
  async PathItemElement(pathItemElement, key, parent, path, ancestors, link) {
221
220
  try {
221
+ var _context3, _context4;
222
222
  // ignore PathItemElement without $ref field
223
223
  if (!(0, _apidomCore.isStringElement)(pathItemElement.$ref)) {
224
224
  return undefined;
225
225
  }
226
226
 
227
227
  // skip current referencing element as it's already been access
228
- if (this.indirections.includes(pathItemElement)) {
228
+ if ((0, _includes.default)(_context3 = this.indirections).call(_context3, pathItemElement)) {
229
229
  return false;
230
230
  }
231
231
 
@@ -277,12 +277,11 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
277
277
  }
278
278
 
279
279
  // detect second deep dive into the same fragment and avoid it
280
- if (ancestorsLineage.includes(referencedElement)) {
280
+ if ((0, _includes.default)(ancestorsLineage).call(ancestorsLineage, referencedElement)) {
281
281
  reference.refSet.circular = true;
282
282
  if (this.options.dereference.circular === 'error') {
283
283
  throw new _apidomError.ApiDOMError('Circular reference detected');
284
284
  } else if (this.options.dereference.circular === 'replace') {
285
- var _this$options$derefer4, _this$options$derefer5;
286
285
  const refElement = new _apidomCore.RefElement(referencedElement.id, {
287
286
  type: 'path-item',
288
287
  uri: reference.uri,
@@ -290,7 +289,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
290
289
  baseURI: $refBaseURI,
291
290
  referencingElement: pathItemElement
292
291
  });
293
- const replacer = (_this$options$derefer4 = (_this$options$derefer5 = this.options.dereference.strategyOpts['openapi-3-2']) == null ? void 0 : _this$options$derefer5.circularReplacer) != null ? _this$options$derefer4 : this.options.dereference.circularReplacer;
292
+ const replacer = this.options.dereference.strategyOpts['openapi-3-2']?.circularReplacer ?? this.options.dereference.circularReplacer;
294
293
  const replacement = replacer(refElement);
295
294
  link.replaceWith(refElement, mutationReplacer);
296
295
  return !parent ? replacement : false;
@@ -307,9 +306,8 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
307
306
  * 4. We are dereferencing the fragment lazily/eagerly depending on circular mode
308
307
  */
309
308
  const isNonRootDocument = _empty.url.stripHash(reference.refSet.rootRef.uri) !== reference.uri;
310
- const shouldDetectCircular = ['error', 'replace'].includes(this.options.dereference.circular);
309
+ const shouldDetectCircular = (0, _includes.default)(_context4 = ['error', 'replace']).call(_context4, this.options.dereference.circular);
311
310
  if ((isExternalReference || isNonRootDocument || (0, _apidomNsOpenapi.isPathItemElement)(referencedElement) && (0, _apidomCore.isStringElement)(referencedElement.$ref) || shouldDetectCircular) && !ancestorsLineage.includesCycle(referencedElement)) {
312
- var _this$basePath3;
313
311
  // append referencing schema to ancestors lineage
314
312
  directAncestors.add(pathItemElement);
315
313
 
@@ -322,7 +320,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
322
320
  ancestors: ancestorsLineage,
323
321
  allowMetaPatches: this.allowMetaPatches,
324
322
  useCircularStructures: this.useCircularStructures,
325
- basePath: (_this$basePath3 = this.basePath) != null ? _this$basePath3 : [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
323
+ basePath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
326
324
  });
327
325
  referencedElement = await visitAsync(referencedElement, visitor, {
328
326
  keyMap: _apidomNsOpenapi.keyMap,
@@ -376,20 +374,20 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
376
374
  */
377
375
  return !parent ? referencedElement : undefined;
378
376
  } catch (error) {
379
- var _this$basePath4, _this$options$derefer6;
380
377
  const rootCause = (0, _getRootCause.default)(error);
381
378
  const wrappedError = wrapError(rootCause, {
382
379
  baseDoc: this.reference.uri,
383
380
  $ref: (0, _apidomCore.toValue)(pathItemElement.$ref),
384
381
  pointer: _modern.URIFragmentIdentifier.fromURIReference((0, _apidomCore.toValue)(pathItemElement.$ref)),
385
- fullPath: (_this$basePath4 = this.basePath) != null ? _this$basePath4 : [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
382
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
386
383
  });
387
- (_this$options$derefer6 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer6 = _this$options$derefer6.errors) == null || _this$options$derefer6.push == null || _this$options$derefer6.push(wrappedError);
384
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
388
385
  return undefined;
389
386
  }
390
387
  }
391
388
  async SchemaElement(referencingElement, key, parent, path, ancestors, link) {
392
389
  try {
390
+ var _context5, _context6;
393
391
  // skip current referencing schema as $ref keyword was not defined
394
392
  if (!(0, _apidomCore.isStringElement)(referencingElement.$ref)) {
395
393
  // skip traversing this schema but traverse all it's child schemas
@@ -397,7 +395,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
397
395
  }
398
396
 
399
397
  // skip current referencing element as it's already been access
400
- if (this.indirections.includes(referencingElement)) {
398
+ if ((0, _includes.default)(_context5 = this.indirections).call(_context5, referencingElement)) {
401
399
  return false;
402
400
  }
403
401
  const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
@@ -529,12 +527,11 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
529
527
  }
530
528
 
531
529
  // detect second deep dive into the same fragment and avoid it
532
- if (ancestorsLineage.includes(referencedElement)) {
530
+ if ((0, _includes.default)(ancestorsLineage).call(ancestorsLineage, referencedElement)) {
533
531
  reference.refSet.circular = true;
534
532
  if (this.options.dereference.circular === 'error') {
535
533
  throw new _apidomError.ApiDOMError('Circular reference detected');
536
534
  } else if (this.options.dereference.circular === 'replace') {
537
- var _this$options$derefer7, _this$options$derefer8;
538
535
  const refElement = new _apidomCore.RefElement(referencedElement.id, {
539
536
  type: 'json-schema',
540
537
  uri: reference.uri,
@@ -542,7 +539,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
542
539
  baseURI: _empty.url.resolve(retrievalURI, $refBaseURI),
543
540
  referencingElement
544
541
  });
545
- const replacer = (_this$options$derefer7 = (_this$options$derefer8 = this.options.dereference.strategyOpts['openapi-3-2']) == null ? void 0 : _this$options$derefer8.circularReplacer) != null ? _this$options$derefer7 : this.options.dereference.circularReplacer;
542
+ const replacer = this.options.dereference.strategyOpts['openapi-3-2']?.circularReplacer ?? this.options.dereference.circularReplacer;
546
543
  const replacement = replacer(refElement);
547
544
  link.replaceWith(replacement, mutationReplacer);
548
545
  return !parent ? replacement : false;
@@ -559,9 +556,8 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
559
556
  * 4. We are dereferencing the fragment lazily/eagerly depending on circular mode
560
557
  */
561
558
  const isNonRootDocument = _empty.url.stripHash(reference.refSet.rootRef.uri) !== reference.uri;
562
- const shouldDetectCircular = ['error', 'replace'].includes(this.options.dereference.circular);
559
+ const shouldDetectCircular = (0, _includes.default)(_context6 = ['error', 'replace']).call(_context6, this.options.dereference.circular);
563
560
  if ((isExternalReference || isNonRootDocument || (0, _apidomNsOpenapi.isSchemaElement)(referencedElement) && (0, _apidomCore.isStringElement)(referencedElement.$ref) || shouldDetectCircular) && !ancestorsLineage.includesCycle(referencedElement)) {
564
- var _this$basePath5;
565
561
  // append referencing schema to ancestors lineage
566
562
  directAncestors.add(referencingElement);
567
563
 
@@ -574,7 +570,7 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
574
570
  useCircularStructures: this.useCircularStructures,
575
571
  allowMetaPatches: this.allowMetaPatches,
576
572
  ancestors: ancestorsLineage,
577
- basePath: (_this$basePath5 = this.basePath) != null ? _this$basePath5 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
573
+ basePath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
578
574
  });
579
575
  referencedElement = await visitAsync(referencedElement, mergeVisitor, {
580
576
  keyMap: _apidomNsOpenapi.keyMap,
@@ -641,15 +637,14 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
641
637
  */
642
638
  return !parent ? referencedElement : undefined;
643
639
  } catch (error) {
644
- var _this$basePath6, _this$options$derefer9;
645
640
  const rootCause = (0, _getRootCause.default)(error);
646
641
  const wrappedError = new _SchemaRefError.default(`Could not resolve reference: ${rootCause.message}`, {
647
642
  baseDoc: this.reference.uri,
648
643
  $ref: (0, _apidomCore.toValue)(referencingElement.$ref),
649
- fullPath: (_this$basePath6 = this.basePath) != null ? _this$basePath6 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref'],
644
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref'],
650
645
  cause: rootCause
651
646
  });
652
- (_this$options$derefer9 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer9 = _this$options$derefer9.errors) == null || _this$options$derefer9.push == null || _this$options$derefer9.push(wrappedError);
647
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
653
648
  return undefined;
654
649
  }
655
650
  }
@@ -667,14 +662,13 @@ class OpenAPI3_2SwaggerClientDereferenceVisitor extends _openapi.OpenAPI3_2Deref
667
662
  try {
668
663
  return await super.ExampleElement(exampleElement, key, parent, path, ancestors, link);
669
664
  } catch (error) {
670
- var _this$basePath7, _this$options$derefer0;
671
665
  const rootCause = (0, _getRootCause.default)(error);
672
666
  const wrappedError = wrapError(rootCause, {
673
667
  baseDoc: this.reference.uri,
674
668
  externalValue: (0, _apidomCore.toValue)(exampleElement.externalValue),
675
- fullPath: (_this$basePath7 = this.basePath) != null ? _this$basePath7 : [...(0, _toPath.default)([...ancestors, parent, exampleElement]), 'externalValue']
669
+ fullPath: this.basePath ?? [...(0, _toPath.default)([...ancestors, parent, exampleElement]), 'externalValue']
676
670
  });
677
- (_this$options$derefer0 = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer0 = _this$options$derefer0.errors) == null || _this$options$derefer0.push == null || _this$options$derefer0.push(wrappedError);
671
+ this.options.dereference.dereferenceOpts?.errors?.push?.(wrappedError);
678
672
  return undefined;
679
673
  }
680
674
  }
@@ -25,12 +25,11 @@ class ParameterMacroVisitor {
25
25
  const macroValue = this.parameterMacro(pojoOperation, pojoParameter);
26
26
  parameterElement.set('default', macroValue);
27
27
  } catch (error) {
28
- var _this$options$derefer;
29
28
  const macroError = new Error(error, {
30
29
  cause: error
31
30
  });
32
31
  macroError.fullPath = (0, _toPath.default)([...ancestors, parent]);
33
- (_this$options$derefer = this.options.dereference.dereferenceOpts) == null || (_this$options$derefer = _this$options$derefer.errors) == null || _this$options$derefer.push == null || _this$options$derefer.push(macroError);
32
+ this.options.dereference.dereferenceOpts?.errors?.push?.(macroError);
34
33
  }
35
34
  }
36
35
  };