fumadocs-openapi 5.5.2 → 5.5.3
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/index.js +11 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -286,14 +286,15 @@ async function generateFiles(options) {
|
|
|
286
286
|
const metaFiles = new Set();
|
|
287
287
|
const results = await generateOperations(pathOrUrl, options);
|
|
288
288
|
await Promise.all(results.map(async (result)=>{
|
|
289
|
-
let
|
|
289
|
+
let outPaths = new Array();
|
|
290
290
|
if (!result.method.operationId) return;
|
|
291
291
|
const id = result.method.operationId.split('.').at(-1) ?? result.method.operationId;
|
|
292
292
|
if (groupBy === 'tag' && result.method.tags && result.method.tags.length > 0) {
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
for (const tag of result.method.tags){
|
|
294
|
+
outPaths.push(join(outputDir, getFilename(tag), `${getFilename(id)}.mdx`));
|
|
295
|
+
}
|
|
295
296
|
} else if (groupBy === 'route') {
|
|
296
|
-
outPath = join(outputDir, result.route.summary ? getFilename(result.route.summary) : getFilenameFromRoute(result.route.path), `${getFilename(id)}.mdx`);
|
|
297
|
+
let outPath = join(outputDir, result.route.summary ? getFilename(result.route.summary) : getFilenameFromRoute(result.route.path), `${getFilename(id)}.mdx`);
|
|
297
298
|
const metaFile = join(dirname(outPath), 'meta.json');
|
|
298
299
|
if (result.route.summary && !metaFiles.has(metaFile)) {
|
|
299
300
|
metaFiles.add(metaFile);
|
|
@@ -302,11 +303,14 @@ async function generateFiles(options) {
|
|
|
302
303
|
}));
|
|
303
304
|
console.log(`Generated Meta: ${metaFile}`);
|
|
304
305
|
}
|
|
306
|
+
outPaths.push(outPath);
|
|
305
307
|
} else {
|
|
306
|
-
|
|
308
|
+
outPaths.push(join(outputDir, `${getFilename(id)}.mdx`));
|
|
309
|
+
}
|
|
310
|
+
for (const outPath of outPaths){
|
|
311
|
+
await write(outPath, result.content);
|
|
312
|
+
console.log(`Generated: ${outPath}`);
|
|
307
313
|
}
|
|
308
|
-
await write(outPath, result.content);
|
|
309
|
-
console.log(`Generated: ${outPath}`);
|
|
310
314
|
}));
|
|
311
315
|
return;
|
|
312
316
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.3",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/react": "^18.3.11",
|
|
56
56
|
"bunchee": "^5.5.1",
|
|
57
57
|
"lucide-react": "^0.453.0",
|
|
58
|
-
"next": "15.0.
|
|
58
|
+
"next": "15.0.1",
|
|
59
59
|
"openapi-types": "^12.1.3",
|
|
60
60
|
"eslint-config-custom": "0.0.0",
|
|
61
61
|
"tsconfig": "0.0.0"
|