openapi-explorer 0.9.357 → 0.9.359

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.
@@ -97,9 +97,9 @@ export function getTypeInfo(schema) {
97
97
  return info;
98
98
  }
99
99
  export function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleStrings) {
100
- var _schemaObj$type;
100
+ var _Object$values$0$valu, _Object$values$, _schemaObj$type;
101
101
 
102
- const example = schemaObj.examples ? schemaObj.examples[0] : schemaObj.example;
102
+ const example = Array.isArray(schemaObj.examples) ? schemaObj.examples[0] : (_Object$values$0$valu = (_Object$values$ = Object.values(schemaObj.examples || {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.value) !== null && _Object$values$0$valu !== void 0 ? _Object$values$0$valu : schemaObj.example;
103
103
 
104
104
  if (example === '') {
105
105
  return '';
@@ -647,7 +647,7 @@ export function generateExample(examples, example, schema, rawMimeType, includeR
647
647
  return finalExamples;
648
648
  }
649
649
 
650
- if (schema && schema.example) {
650
+ if (schema !== null && schema !== void 0 && schema.example) {
651
651
  // Note: schema.examples (plurals) is not allowed as per spec
652
652
  return [{
653
653
  exampleId: 'Example',
@@ -112,9 +112,9 @@ function getTypeInfo(schema) {
112
112
  }
113
113
 
114
114
  function getSampleValueByType(schemaObj, fallbackPropertyName, skipExampleStrings) {
115
- var _schemaObj$type;
115
+ var _Object$values$0$valu, _Object$values$, _schemaObj$type;
116
116
 
117
- const example = schemaObj.examples ? schemaObj.examples[0] : schemaObj.example;
117
+ const example = Array.isArray(schemaObj.examples) ? schemaObj.examples[0] : (_Object$values$0$valu = (_Object$values$ = Object.values(schemaObj.examples || {})[0]) === null || _Object$values$ === void 0 ? void 0 : _Object$values$.value) !== null && _Object$values$0$valu !== void 0 ? _Object$values$0$valu : schemaObj.example;
118
118
 
119
119
  if (example === '') {
120
120
  return '';
@@ -664,7 +664,7 @@ function generateExample(examples, example, schema, rawMimeType, includeReadOnly
664
664
  return finalExamples;
665
665
  }
666
666
 
667
- if (schema && schema.example) {
667
+ if (schema !== null && schema !== void 0 && schema.example) {
668
668
  // Note: schema.examples (plurals) is not allowed as per spec
669
669
  return [{
670
670
  exampleId: 'Example',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-explorer",
3
- "version": "0.9.357",
3
+ "version": "0.9.359",
4
4
  "description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
5
5
  "author": "Rhosys Developers <developers@rhosys.ch>",
6
6
  "repository": {