theGagne
Difficulty using OpenAPI registry parameters with createRoute
My setup is
index.ts -> has hono app, imports routes
schema.ts -> has zod schemas defined
routes.ts -> uses createRoute from defined schemas
I want to define parameters like user_id, etc and register them and use $ref to refer to them. This would clean up the openapi and reduces repetition.
I'm having difficulty getting this to work. Does anyone have an example of this working? It's also a little clunky, it seems like you end up with a zod string which must get registered, and then that used inside a zod object that goes in the param? In any case the DX on this is not great and I've wasted a few hours already trying to get it to work.
3 replies