fumadocs-openapi 5.3.1 → 5.3.2
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/dist/server/index.js +32 -26
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -468,6 +468,38 @@ function heading(depth, child, ctx) {
|
|
|
468
468
|
}, id);
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
+
/**
|
|
472
|
+
* Combine multiple object schemas into one
|
|
473
|
+
*/ function combineSchema(schema) {
|
|
474
|
+
const result = {
|
|
475
|
+
type: 'object'
|
|
476
|
+
};
|
|
477
|
+
function add(s) {
|
|
478
|
+
if (s.properties) {
|
|
479
|
+
var _result;
|
|
480
|
+
(_result = result).properties ?? (_result.properties = {});
|
|
481
|
+
Object.assign(result.properties, s.properties);
|
|
482
|
+
}
|
|
483
|
+
if (s.additionalProperties === true) {
|
|
484
|
+
result.additionalProperties = true;
|
|
485
|
+
} else if (s.additionalProperties && typeof result.additionalProperties !== 'boolean') {
|
|
486
|
+
var _result1;
|
|
487
|
+
(_result1 = result).additionalProperties ?? (_result1.additionalProperties = {});
|
|
488
|
+
Object.assign(result.additionalProperties, s.additionalProperties);
|
|
489
|
+
}
|
|
490
|
+
if (s.required) {
|
|
491
|
+
var _result2;
|
|
492
|
+
(_result2 = result).required ?? (_result2.required = []);
|
|
493
|
+
result.required.push(...s.required);
|
|
494
|
+
}
|
|
495
|
+
if (s.allOf) {
|
|
496
|
+
noRef(s.allOf).forEach(add);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
schema.forEach(add);
|
|
500
|
+
return result;
|
|
501
|
+
}
|
|
502
|
+
|
|
471
503
|
const keys = {
|
|
472
504
|
default: 'Default',
|
|
473
505
|
minimum: 'Minimum',
|
|
@@ -613,32 +645,6 @@ function Schema({ name, schema, ctx }) {
|
|
|
613
645
|
children: child
|
|
614
646
|
});
|
|
615
647
|
}
|
|
616
|
-
/**
|
|
617
|
-
* Combine multiple object schemas into one
|
|
618
|
-
*/ function combineSchema(schema) {
|
|
619
|
-
const result = {
|
|
620
|
-
type: 'object'
|
|
621
|
-
};
|
|
622
|
-
function add(s) {
|
|
623
|
-
if (s.properties) {
|
|
624
|
-
var _result;
|
|
625
|
-
(_result = result).properties ?? (_result.properties = {});
|
|
626
|
-
Object.assign(result.properties, s.properties);
|
|
627
|
-
}
|
|
628
|
-
if (s.additionalProperties === true) {
|
|
629
|
-
result.additionalProperties = true;
|
|
630
|
-
} else if (s.additionalProperties && typeof result.additionalProperties !== 'boolean') {
|
|
631
|
-
var _result1;
|
|
632
|
-
(_result1 = result).additionalProperties ?? (_result1.additionalProperties = {});
|
|
633
|
-
Object.assign(result.additionalProperties, s.additionalProperties);
|
|
634
|
-
}
|
|
635
|
-
if (s.allOf) {
|
|
636
|
-
noRef(s.allOf).forEach(add);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
schema.forEach(add);
|
|
640
|
-
return result;
|
|
641
|
-
}
|
|
642
648
|
/**
|
|
643
649
|
* Check if the schema needs another collapsible to explain
|
|
644
650
|
*/ function isComplexType(schema) {
|