fumadocs-openapi 10.0.10 → 10.0.11
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/operation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAEV,iBAAiB,EACjB,aAAa,EAEd,MAAM,SAAS,CAAC;AAqCjB,wBAAsB,SAAS,CAAC,EAC9B,IAAkB,EAClB,IAAI,EACJ,MAAM,EACN,GAAG,EACH,OAAO,EACP,YAAgB,GACjB,EAAE;IACD,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,aAAa,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/operation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAEV,iBAAiB,EACjB,aAAa,EAEd,MAAM,SAAS,CAAC;AAqCjB,wBAAsB,SAAS,CAAC,EAC9B,IAAkB,EAClB,IAAI,EACJ,MAAM,EACN,GAAG,EACH,OAAO,EACP,YAAgB,GACjB,EAAE;IACD,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,aAAa,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,kIAsQA"}
|
|
@@ -44,7 +44,7 @@ export async function Operation({ type = 'operation', path, method, ctx, hasHead
|
|
|
44
44
|
}
|
|
45
45
|
if (method.responses && ctx.showResponseSchema !== false) {
|
|
46
46
|
const statuses = Object.keys(method.responses);
|
|
47
|
-
responseNode = (_jsxs(_Fragment, { children: [ctx.renderHeading(headingLevel, 'Response Body'), _jsx(Accordions, { type: "multiple", children: statuses.map((status) => (_jsx(
|
|
47
|
+
responseNode = (_jsxs(_Fragment, { children: [ctx.renderHeading(headingLevel, 'Response Body'), _jsx(Accordions, { type: "multiple", children: statuses.map((status) => (_jsx(ResponseAccordion, { status: status, operation: method, ctx: ctx }, status))) })] }));
|
|
48
48
|
}
|
|
49
49
|
const parameterNode = Object.entries(ParamTypes).map(([type, title]) => {
|
|
50
50
|
const params = method.parameters?.filter((param) => param.in === type);
|
|
@@ -109,11 +109,15 @@ async function ResponseAccordion({ status, operation, ctx, }) {
|
|
|
109
109
|
const response = operation.responses[status];
|
|
110
110
|
const { generateTypeScriptSchema } = ctx;
|
|
111
111
|
const contentTypes = response.content ? Object.entries(response.content) : [];
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
let wrapper = (children) => children;
|
|
113
|
+
let selectorNode = null;
|
|
114
|
+
if (contentTypes.length > 0) {
|
|
115
|
+
const [defaultValue] = contentTypes[0];
|
|
116
|
+
selectorNode =
|
|
117
|
+
contentTypes.length === 1 ? (_jsx("p", { className: "text-sm text-fd-muted-foreground", children: defaultValue })) : (_jsx(SelectTabTrigger, { items: contentTypes.map(([key]) => key) }));
|
|
118
|
+
wrapper = (children) => (_jsx(SelectTabs, { defaultValue: defaultValue, children: children }));
|
|
114
119
|
}
|
|
115
|
-
|
|
116
|
-
return (_jsxs(SelectTabs, { defaultValue: defaultValue, children: [_jsxs(AccordionHeader, { children: [_jsx(AccordionTrigger, { className: "font-mono", children: status }), contentTypes.length > 1 ? (_jsx(SelectTabTrigger, { items: contentTypes.map(([key]) => key) })) : (_jsx("p", { className: "text-sm text-fd-muted-foreground", children: defaultValue }))] }), _jsxs(AccordionContent, { className: "ps-4.5", children: [response.description && (_jsx("div", { className: "prose-no-margin", children: ctx.renderMarkdown(response.description) })), contentTypes.map(async ([type, resType]) => {
|
|
120
|
+
return wrapper(_jsxs(AccordionItem, { value: status, children: [_jsxs(AccordionHeader, { children: [_jsx(AccordionTrigger, { className: "font-mono", children: status }), selectorNode] }), _jsxs(AccordionContent, { className: "ps-4.5", children: [response.description && (_jsx("div", { className: "prose-no-margin", children: ctx.renderMarkdown(response.description) })), contentTypes.map(async ([type, resType]) => {
|
|
117
121
|
const schema = resType.schema;
|
|
118
122
|
let ts;
|
|
119
123
|
if (generateTypeScriptSchema) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.11",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"remark-rehype": "^11.1.2",
|
|
70
70
|
"tinyglobby": "^0.2.15",
|
|
71
71
|
"xml-js": "^1.6.11",
|
|
72
|
-
"fumadocs-core": "16.0
|
|
73
|
-
"fumadocs-ui": "16.0
|
|
72
|
+
"fumadocs-core": "16.1.0",
|
|
73
|
+
"fumadocs-ui": "16.1.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@scalar/api-client-react": "^1.3.50",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"openapi-types": "^12.1.3",
|
|
83
83
|
"tailwindcss": "^4.1.17",
|
|
84
84
|
"tsc-alias": "^1.8.16",
|
|
85
|
-
"
|
|
86
|
-
"
|
|
85
|
+
"tsconfig": "0.0.0",
|
|
86
|
+
"eslint-config-custom": "0.0.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@scalar/api-client-react": "*",
|