Skip to content

Support for schema containing ZodIntersection or ZodDefault聽#9

Open

Description

@SimonSimCity

Thanks for this library so far 馃帀

Driven by the same error as reported in #8, I analyzed why my schema was failing.

I debugged and found out that the generator currently throws an error if the instance it expects to be a zod-object does not exactly match one of the tested types (ZodObject, ZodVoid or ZodOptional): https://github.com/dtinth/openapi-trpc/blob/main/src/generate.ts#L141

I'd like that list to be extend to include ZodIntersection and ZodDefault as well - I use them in my schema, and I didn't run into a problem when just adding it to the code of this package.

If you see anything I might have overlooked, please tell me and I'm happy to test it more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions