asteasolutions / zod-to-openapi

A library that generates OpenAPI (Swagger) docs from Zod schemas
MIT License
955 stars 60 forks source link

Nested discriminated unions #239

Closed vickyRathee closed 4 months ago

vickyRathee commented 4 months ago

This was merged way back (https://github.com/colinhacks/zod/pull/1589) on Zod but I am still unable to use nested discriminated unions with @hono/zod-openapi. Any suggestion?

The example is taken from the refereeing PR.

image

AGalabov commented 4 months ago

@vickyRathee this is not @hono/zod-to-openapi - they use our library but handle things on their own.

However for your issue - the ticket mentioned never actually got anything merged - it was closed. You can see Colin's comment here: https://github.com/colinhacks/zod/pull/1589#issuecomment-2013975822 that mentions why this would NOT be implemented and a possible alternative that can be used.

I am closing this issue.