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

fix(generator): Nullability of JSON field is reversed #240

Merged
merged 1 commit into from May 23, 2024

Conversation

nordowl
Copy link
Contributor

@nordowl nordowl commented Feb 1, 2024

Fixes #238

Tested locally with a simple schema:

model User {
  id String @unique
  name String
  bio Json
}

model UserOptional {
  id String @unique
  name String?
  bio Json?
}

now correctly generates

export const UserSchema = z.object({
  id: z.string(),
  name: z.string(),
  bio: JsonValueSchema,
})

export const UserOptionalSchema = z.object({
  id: z.string(),
  name: z.string().nullable(),
  bio: JsonValueSchema.nullable(),
})

@nordowl nordowl changed the title fix(generator): Nullable JSON field is reversed fix(generator): Nullability of JSON field is reversed Feb 1, 2024
Copy link
Owner

@chrishoermann chrishoermann left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. I'll release it as soon as possible

@chrishoermann chrishoermann merged commit 514466c into chrishoermann:master May 23, 2024
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.

[BUG] nullable is reversed on json type
2 participants