blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
155 stars 20 forks source link

Incorrect paths generated when multiple path parameters are present #96

Closed ctdio closed 11 months ago

ctdio commented 11 months ago

Hey there!

Great package you've created here! I've noticed an issue with the OpenAPI paths generated when more than one path parameter is supplied.

The package converts routes like /api/foo/bar/[qux]/route.ts to /api/foo/bar/{qux} just fine, but fails to convert paths when more than one path parameter exists.

For example, a path like /api/foo/bar/[qux]/quux/[corge]/route.ts gets converted to /api/foo/bar/{qux}/quux/[corge]. This ends up causing some pain when attempting to generate clients from the OpenAPI spec.

I think I found where the problem lies and will have a PR up shortly to fix this.

blomqma commented 11 months ago

Thanks for the contribution, this is resolved in v3.4.3.