✅ Handling or omitting recursive schemas from openapi doc generation #801
TheWisestOne
started this conversation in
Ideas
Replies: 4 comments 2 replies
-
Hmmm... that's an interesting problem. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Perhaps I could use OpenAPI's schema references for describing recursion. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I found a way to do it in #856 |
Beta Was this translation helpful? Give feedback.
0 replies
-
🚀 The feature released in v9.3.1, @TheWisestOne |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
One of the APIs includes a return type that includes a recursive type definition. The way to do this in
zod
is to use thez.lazy
function and make a self-referential type.However, when using express-zod-api to generate
open-api
swagger docs, we get an errorTo me it makes sense that generating swagger docs for a recursive type might be hard / obnoxious, but I'm wondering if there's a way for me to still use
express-zod-api
to include this route in myrouting
, but simply omit it from my generated api docs (or better yet, override the output type in my api docs to just be a simplified version that doesn't include the recursive key)?Beta Was this translation helpful? Give feedback.
All reactions