Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type: 'null' generates invalid zod client #1253

Closed
canvural opened this issue Mar 6, 2024 · 0 comments · Fixed by #1255
Closed

type: 'null' generates invalid zod client #1253

canvural opened this issue Mar 6, 2024 · 0 comments · Fixed by #1255
Labels
bug Something isn't working zod Zod related issue
Milestone

Comments

@canvural
Copy link

canvural commented Mar 6, 2024

What are the steps to reproduce this issue?

  1. Given the following schema
foo:
  type: 'null'
  1. Orval generates a zod client that contains zod.mixed()
  2. which causes type error Property 'mixed' does not exist on type 'typeof import("node_modules/zod/lib/external")'

But using type: ['null'] does not cause the error. So not really sure if it is a bug or I'm misusing something 🤔

What happens?

Causes type error Property 'mixed' does not exist on type 'typeof import("node_modules/zod/lib/external")'

What were you expecting to happen?

No error.

Any logs, error output, etc?

Property 'mixed' does not exist on type 'typeof import("node_modules/zod/lib/external")'

Any other comments?

Issue seems to come from here.

What versions are you using?

Operating System:
Package Version: 6.25.0
Browser Version:

rmachado-studocu added a commit to rmachado-studocu/orval that referenced this issue Mar 6, 2024
@melloware melloware added the bug Something isn't working label Mar 6, 2024
@melloware melloware added this to the 6.26.0 milestone Mar 6, 2024
@melloware melloware added the zod Zod related issue label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working zod Zod related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants