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

Zod schema mismatch from the contracts (missing .nullable()) #217

Open
PeterMK85 opened this issue Aug 22, 2023 · 0 comments
Open

Zod schema mismatch from the contracts (missing .nullable()) #217

PeterMK85 opened this issue Aug 22, 2023 · 0 comments

Comments

@PeterMK85
Copy link
Contributor

Describe the bug

Minimal reproduction
Example

OpenApi:

   Example:
      description: 'Array of daily data points [[epoch-millis, metric-value], ..., [epoch-millis, metric-value]]. Data quality issues can cause the metric value to be null.'
      additionalProperties: false
      type: array
      items:
        additionalProperties: false
        type: array
        minItems: 2
        maxItems: 2
        items:
          type: number
          nullable: true
          readOnly: true
        readOnly: true
      readOnly: true

Zod:

const Example = z.array(z.array(z.number()));

Expected behavior
Zod:

const Example = z.array(z.array(z.number().nullable()));

Additional context
It seems the generated type properly reflects the type

type Example = Array<Array<number | null>>
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

No branches or pull requests

1 participant