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
My schema contains the query parameter tags which is an array of zero or more values.
However, the problem is that tags is only transformed into an array in req.query if it is used more than once in the url:
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 use zod to parse query parameters in Next.JS:
My schema contains the query parameter
tags
which is an array of zero or more values.However, the problem is that
tags
is only transformed into an array inreq.query
if it is used more than once in the url:I have been able to get around this by using
union
:However, this causes
zod-to-openapi
to produce a schema like this:rather than the desired
Is there a way to make
zod-to-openapi
understand that I want the second output?(Why is this important? Because it causes swagger ui to render two different styles of input)
Beta Was this translation helpful? Give feedback.
All reactions