wineT
[zod-openapi] How to generate a separate requestBody component?
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?2 replies