Skip to content

fix(zod): include array items schema in JSON schema output (#104)#104

Merged
dinwwwh merged 1 commit intomiddleapi:mainfrom
HamishWHC:feat/openapi-recurse-into-zod-arrays
Feb 1, 2025
Merged

fix(zod): include array items schema in JSON schema output (#104)#104
dinwwwh merged 1 commit intomiddleapi:mainfrom
HamishWHC:feat/openapi-recurse-into-zod-arrays

Conversation

@HamishWHC
Copy link
Copy Markdown
Contributor

Found the relevant code and added this myself. Would like to help with issues like this where I can :)

Might be worth considering changing the test to not involve arrays (e.g. left/right instead of children, or a linked list instead of a tree), as it seems to be testing two features (lazy + arrays). The original test wasn't actually testing the lazy functionality as the converter wouldn't recurse into the array.

Fixes #102

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2025 2:50am

@dinwwwh
Copy link
Copy Markdown
Member

dinwwwh commented Jan 26, 2025

Thanks for your PR! Unfortunately, I can't merge it just yet. We'll need to wait until the new builder is released, as the current branch has significant issues with the lazy router. Merging this now wouldn't allow for a release anyway. I appreciate your understanding!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 26, 2025

Open in Stackblitz

More templates

@orpc/client

npm i https://pkg.pr.new/@orpc/client@104

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@104

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@104

@orpc/server

npm i https://pkg.pr.new/@orpc/server@104

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@104

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@104

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@104

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@104

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@104

commit: 3bc29c8

Copy link
Copy Markdown
Member

@dinwwwh dinwwwh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@dinwwwh dinwwwh changed the title fix: recurse into ZodArray during openapi generation fix(zod): include array items schema in JSON schema output (#104) Feb 1, 2025
@dinwwwh dinwwwh merged commit bc564a6 into middleapi:main Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Zod array introspection when generating OpenAPI spec.

2 participants