Open valerii15298 opened 2 months ago
Just chiming in here that this would also open up support for zod-to-openapi (looks like a similar independent library). I've tried other methods and it's seeming just not able to be done yet.
Additionally, other supported methods like .describe()
aren't available without overriding the original type as well (that errors with 'describe' is not a valid validator type.
)
Is your feature request related to a problem? Please describe. I wanna use prisma with Hono zod-opeapi
Basically like this:
Describe the solution you'd like The best solution would be just to append any string to generated schema type like this
So that after
@append
there could be any string. And it will generate:Basically
.openapi({example: 'John Doe'})
is appended as a string to already default generated typez.string()
Describe alternatives you've considered Using
/// @zod.custom.use(z.string().openapi({example: 'John Doe'}))
but it will overwrite whole type, while I just want extend it append to default generated type Put a comment and then use bash script to format correct schema