Closed jameslshannon closed 4 months ago
Yeah having support for both the Zod describe
method being included in the OpenAPI spec and an explicit JSON schema for the path parameters makes sense. I'm currently working on adding support for those in https://github.com/blomqma/next-rest-framework/pull/155. The only problem is that with pages router, Next.js includes both the path parameters and query parameters within the req.query
object so we need separate validation for those with pages router as well.
These changes are now published in v6.0.0-beta.3
.
Looks like zod doesn't output descriptions for params decorated using describe(), so ideally we could also specify a paramsSchema (just like bodySchema and querySchema) so that additional openapi schema info can be added for params and therefore included in the generated oas file.