fumadocs-openapi 10.0.11 → 10.1.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.
- package/dist/generate-file.d.ts +6 -5
- package/dist/generate-file.d.ts.map +1 -1
- package/dist/generate-file.js +44 -37
- package/dist/playground/client.d.ts +9 -7
- package/dist/playground/client.d.ts.map +1 -1
- package/dist/playground/client.js +7 -7
- package/dist/playground/components/inputs.d.ts +6 -6
- package/dist/playground/components/inputs.d.ts.map +1 -1
- package/dist/playground/components/inputs.js +13 -12
- package/dist/playground/get-default-values.d.ts +2 -2
- package/dist/playground/get-default-values.d.ts.map +1 -1
- package/dist/playground/index.d.ts +1 -2
- package/dist/playground/index.d.ts.map +1 -1
- package/dist/playground/index.js +2 -0
- package/dist/playground/schema.d.ts +22 -8
- package/dist/playground/schema.d.ts.map +1 -1
- package/dist/playground/schema.js +29 -34
- package/dist/requests/generators/index.d.ts +1 -1
- package/dist/requests/generators/index.d.ts.map +1 -1
- package/dist/server/create.d.ts +1 -1
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/source-api.d.ts +5 -3
- package/dist/server/source-api.d.ts.map +1 -1
- package/dist/server/source-api.js +13 -7
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/api-page.d.ts +16 -8
- package/dist/ui/api-page.d.ts.map +1 -1
- package/dist/ui/api-page.js +7 -7
- package/dist/ui/client/index.d.ts +2 -2
- package/dist/ui/client/index.d.ts.map +1 -1
- package/dist/ui/operation/client.d.ts +5 -2
- package/dist/ui/operation/client.d.ts.map +1 -1
- package/dist/ui/operation/client.js +2 -2
- package/dist/ui/operation/index.d.ts +4 -3
- package/dist/ui/operation/index.d.ts.map +1 -1
- package/dist/ui/operation/index.js +67 -33
- package/dist/ui/operation/request-tabs.d.ts +18 -0
- package/dist/ui/operation/request-tabs.d.ts.map +1 -0
- package/dist/ui/operation/request-tabs.js +143 -0
- package/dist/ui/operation/response-tabs.d.ts +32 -0
- package/dist/ui/operation/response-tabs.d.ts.map +1 -0
- package/dist/ui/operation/response-tabs.js +59 -0
- package/dist/ui/operation/usage-tabs/client.d.ts +23 -0
- package/dist/ui/operation/usage-tabs/client.d.ts.map +1 -0
- package/dist/ui/operation/{example-panel → usage-tabs}/client.js +50 -6
- package/dist/ui/operation/usage-tabs/index.d.ts +26 -0
- package/dist/ui/operation/usage-tabs/index.d.ts.map +1 -0
- package/dist/ui/operation/usage-tabs/index.js +52 -0
- package/dist/ui/operation/usage-tabs/lazy.d.ts +4 -0
- package/dist/ui/operation/usage-tabs/lazy.d.ts.map +1 -0
- package/dist/ui/operation/usage-tabs/lazy.js +5 -0
- package/dist/ui/schema/client.d.ts +1 -3
- package/dist/ui/schema/client.d.ts.map +1 -1
- package/dist/ui/schema/client.js +13 -17
- package/dist/ui/schema/index.d.ts +19 -5
- package/dist/ui/schema/index.d.ts.map +1 -1
- package/dist/ui/schema/index.js +69 -29
- package/dist/utils/deep-equal.d.ts +2 -0
- package/dist/utils/deep-equal.d.ts.map +1 -0
- package/dist/utils/deep-equal.js +27 -0
- package/dist/utils/merge-schema.d.ts +7 -0
- package/dist/utils/merge-schema.d.ts.map +1 -0
- package/dist/utils/merge-schema.js +179 -0
- package/dist/utils/pages/to-body.d.ts.map +1 -1
- package/dist/utils/pages/to-body.js +2 -3
- package/dist/utils/pages/to-text.d.ts.map +1 -1
- package/dist/utils/pages/to-text.js +31 -16
- package/dist/utils/schema-to-string.d.ts.map +1 -1
- package/dist/utils/schema-to-string.js +8 -5
- package/dist/utils/use-query.d.ts +1 -0
- package/dist/utils/use-query.d.ts.map +1 -1
- package/dist/utils/use-query.js +5 -0
- package/package.json +14 -14
- package/dist/ui/contexts/operation.d.ts +0 -20
- package/dist/ui/contexts/operation.d.ts.map +0 -1
- package/dist/ui/contexts/operation.js +0 -48
- package/dist/ui/contexts/operation.lazy.d.ts +0 -2
- package/dist/ui/contexts/operation.lazy.d.ts.map +0 -1
- package/dist/ui/contexts/operation.lazy.js +0 -3
- package/dist/ui/operation/example-panel/client.d.ts +0 -4
- package/dist/ui/operation/example-panel/client.d.ts.map +0 -1
- package/dist/ui/operation/example-panel/index.d.ts +0 -58
- package/dist/ui/operation/example-panel/index.d.ts.map +0 -1
- package/dist/ui/operation/example-panel/index.js +0 -140
- package/dist/ui/operation/example-panel/lazy.d.ts +0 -3
- package/dist/ui/operation/example-panel/lazy.d.ts.map +0 -1
- package/dist/ui/operation/example-panel/lazy.js +0 -4
- package/dist/ui/operation/get-request-data.d.ts +0 -4
- package/dist/ui/operation/get-request-data.d.ts.map +0 -1
- package/dist/ui/operation/get-request-data.js +0 -70
- package/dist/utils/combine-schema.d.ts +0 -6
- package/dist/utils/combine-schema.d.ts.map +0 -1
- package/dist/utils/combine-schema.js +0 -51
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Combine multiple object schemas into one
|
|
3
|
-
*/
|
|
4
|
-
export function combineSchema(schema) {
|
|
5
|
-
let result = {};
|
|
6
|
-
const types = new Set();
|
|
7
|
-
const title = new Set();
|
|
8
|
-
function add(s) {
|
|
9
|
-
if (typeof s === 'boolean') {
|
|
10
|
-
result = s;
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (typeof result === 'boolean')
|
|
14
|
-
return;
|
|
15
|
-
if (s.title)
|
|
16
|
-
title.add(s.title);
|
|
17
|
-
if (s.type) {
|
|
18
|
-
for (const v of Array.isArray(s.type) ? s.type : [s.type]) {
|
|
19
|
-
types.add(v);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
for (const key of ['oneOf', 'required', 'enum']) {
|
|
23
|
-
if (!s[key])
|
|
24
|
-
continue;
|
|
25
|
-
result[key] = [...s[key], ...(result[key] ?? [])];
|
|
26
|
-
}
|
|
27
|
-
for (const key of ['properties', 'patternProperties']) {
|
|
28
|
-
if (!s[key])
|
|
29
|
-
continue;
|
|
30
|
-
result[key] ?? (result[key] = {});
|
|
31
|
-
Object.assign(result[key], s[key]);
|
|
32
|
-
}
|
|
33
|
-
if (s.additionalProperties === true) {
|
|
34
|
-
result.additionalProperties = true;
|
|
35
|
-
}
|
|
36
|
-
else if (s.additionalProperties &&
|
|
37
|
-
typeof result.additionalProperties !== 'boolean') {
|
|
38
|
-
result.additionalProperties ?? (result.additionalProperties = {});
|
|
39
|
-
Object.assign(result.additionalProperties, s.additionalProperties);
|
|
40
|
-
}
|
|
41
|
-
(s.allOf ?? s.anyOf)?.forEach(add);
|
|
42
|
-
}
|
|
43
|
-
schema.forEach(add);
|
|
44
|
-
if (title.size > 0)
|
|
45
|
-
result.title = Array.from(title).join(' & ');
|
|
46
|
-
if (types.size > 0) {
|
|
47
|
-
const typeArr = Array.from(types.values());
|
|
48
|
-
result.type = typeArr.length === 1 ? typeArr[0] : typeArr;
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
}
|