next-openapi-gen 0.7.4 → 0.7.5

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.
@@ -265,6 +265,8 @@ export class RouteProcessor {
265
265
  relativePath = relativePath.replace(/\/route\.tsx?$/, "");
266
266
  // Convert directory separators to URL path format
267
267
  relativePath = relativePath.replaceAll("\\", "/");
268
+ // Remove Next.js route groups (folders in parentheses like (authenticated), (marketing))
269
+ relativePath = relativePath.replace(/\/\([^)]+\)/g, "");
268
270
  // Convert Next.js dynamic route syntax to OpenAPI parameter syntax
269
271
  relativePath = relativePath.replace(/\/\[([^\]]+)\]/g, "/{$1}");
270
272
  // Handle catch-all routes ([...param])
@@ -277,6 +279,7 @@ export class RouteProcessor {
277
279
  .replace(/route\.tsx?$/, "")
278
280
  .replaceAll("\\", "/")
279
281
  .replace(/\/$/, "")
282
+ .replace(/\/\([^)]+\)/g, "") // Remove route groups for pages router too
280
283
  .replace(/\/\[([^\]]+)\]/g, "/{$1}") // Replace [param] with {param}
281
284
  .replace(/\/\[\.\.\.(.*)\]/g, "/{$1}"); // Replace [...param] with {param}
282
285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-openapi-gen",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Automatically generate OpenAPI 3.0 documentation from Next.js projects, with support for Zod schemas and TypeScript types.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",