You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have several routes that get media files from user requests, and I want to separate them into a separate component to reuse them. But, I also have an array of allowed types to upload. So, I want to make the schema autogenerate itself when I add a new mime type to the array.
I wrote this abomination and it doesn't work. I should have stopped when typescript stopped showing the appropriate type for mediaRequestBody.
// I'm using @hono/zod-openapi. Under the hood of `createRoute` it runs `registerPath`exportconstUpdateUserMediaRoute=createRoute({method: 'put',path: '/users/{userId}/media/{mediaId}',request: {params: ...
body: {content: mediaRequestBody}},responses: ...
})
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have several routes that get media files from user requests, and I want to separate them into a separate component to reuse them. But, I also have an array of allowed types to upload. So, I want to make the schema autogenerate itself when I add a new mime type to the array.
I wrote this abomination and it doesn't work. I should have stopped when typescript stopped showing the appropriate type for
mediaRequestBody
.Here is how I'm using it:
What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions