@mintlify/common 1.0.344 → 1.0.345

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.
@@ -1,6 +1,6 @@
1
1
  import { generateExampleFromSchema } from '@mintlify/validation';
2
2
  export const getExamplesData = ({ message, jsonSchema, payloadSchema, extensions, }) => {
3
- var _a, _b, _c;
3
+ var _a, _b, _c, _d, _e;
4
4
  const id = message.id().toLowerCase();
5
5
  const examples = message.examples();
6
6
  const hasInlineExamples = examples.length > 0;
@@ -8,8 +8,11 @@ export const getExamplesData = ({ message, jsonSchema, payloadSchema, extensions
8
8
  const example = (_b = (_a = examples[0]) === null || _a === void 0 ? void 0 : _a['_json']) === null || _b === void 0 ? void 0 : _b['payload'];
9
9
  return JSON.stringify(example, null, 2);
10
10
  }
11
- const jsonExamples = (_c = jsonSchema['schema']) === null || _c === void 0 ? void 0 : _c['examples'];
12
- const hasJsonExamples = jsonExamples && jsonExamples.length > 0;
11
+ const jsonExamples = [
12
+ ...((_c = jsonSchema['examples']) !== null && _c !== void 0 ? _c : []),
13
+ ...((_e = (_d = jsonSchema['schema']) === null || _d === void 0 ? void 0 : _d['examples']) !== null && _e !== void 0 ? _e : []),
14
+ ];
15
+ const hasJsonExamples = jsonExamples.length > 0;
13
16
  if (hasJsonExamples) {
14
17
  return JSON.stringify(jsonExamples[0], null, 2);
15
18
  }