fumadocs-openapi 5.3.0 → 5.3.1

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.
@@ -521,6 +521,13 @@ function Schema({ name, schema, ctx }) {
521
521
  }
522
522
  return child;
523
523
  }
524
+ if (schema.allOf && parseObject) {
525
+ return /*#__PURE__*/ jsx(Schema, {
526
+ name: name,
527
+ schema: combineSchema(noRef(schema.allOf)),
528
+ ctx: ctx
529
+ });
530
+ }
524
531
  if (schema.description) child.push(/*#__PURE__*/ jsx(Markdown, {
525
532
  text: schema.description
526
533
  }, "description"));
@@ -540,17 +547,22 @@ function Schema({ name, schema, ctx }) {
540
547
  });
541
548
  }
542
549
  if (fields.length > 0) child.push(/*#__PURE__*/ jsx("p", {
543
- children: fields.map((field)=>/*#__PURE__*/ jsxs("span", {
550
+ children: fields.map((field, i)=>/*#__PURE__*/ jsxs(Fragment, {
544
551
  children: [
545
- field.key,
546
- ": ",
547
- /*#__PURE__*/ jsx("code", {
548
- children: field.value
549
- })
552
+ /*#__PURE__*/ jsxs("span", {
553
+ children: [
554
+ field.key,
555
+ ": ",
556
+ /*#__PURE__*/ jsx("code", {
557
+ children: field.value
558
+ })
559
+ ]
560
+ }),
561
+ i !== fields.length - 1 ? /*#__PURE__*/ jsx("br", {}) : null
550
562
  ]
551
563
  }, field.key))
552
564
  }, "fields"));
553
- if (isObject(schema) && !parseObject) {
565
+ if ((isObject(schema) || schema.allOf) && !parseObject) {
554
566
  child.push(/*#__PURE__*/ jsx(renderer.ObjectCollapsible, {
555
567
  name: "Attributes",
556
568
  children: /*#__PURE__*/ jsx(Schema, {
@@ -563,19 +575,6 @@ function Schema({ name, schema, ctx }) {
563
575
  }
564
576
  })
565
577
  }, "attributes"));
566
- } else if (schema.allOf) {
567
- child.push(/*#__PURE__*/ jsx(renderer.ObjectCollapsible, {
568
- name: name,
569
- children: /*#__PURE__*/ jsx(Schema, {
570
- name: name,
571
- schema: combineSchema(noRef(schema.allOf)),
572
- ctx: {
573
- ...ctx,
574
- parseObject: true,
575
- required: false
576
- }
577
- })
578
- }, "attributes"));
579
578
  } else {
580
579
  const mentionedObjectTypes = [
581
580
  ...schema.anyOf ?? schema.oneOf ?? [],
@@ -621,19 +620,20 @@ function Schema({ name, schema, ctx }) {
621
620
  type: 'object'
622
621
  };
623
622
  function add(s) {
624
- var _result, _result1;
625
- (_result = result).properties ?? (_result.properties = {});
626
623
  if (s.properties) {
624
+ var _result;
625
+ (_result = result).properties ?? (_result.properties = {});
627
626
  Object.assign(result.properties, s.properties);
628
627
  }
629
- (_result1 = result).additionalProperties ?? (_result1.additionalProperties = {});
630
628
  if (s.additionalProperties === true) {
631
629
  result.additionalProperties = true;
632
630
  } else if (s.additionalProperties && typeof result.additionalProperties !== 'boolean') {
631
+ var _result1;
632
+ (_result1 = result).additionalProperties ?? (_result1.additionalProperties = {});
633
633
  Object.assign(result.additionalProperties, s.additionalProperties);
634
634
  }
635
635
  if (s.allOf) {
636
- add(combineSchema(noRef(s.allOf)));
636
+ noRef(s.allOf).forEach(add);
637
637
  }
638
638
  }
639
639
  schema.forEach(add);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",