You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Foo {
a String
}
model Bar {
id String @id @default(cuid())
foo Foo @json @default("{ \"a\": \"a\" }")
fooList Foo[] @json @default("[{ \"a\": \"b\" }]")
}
@default args on Typed JSON fields currently fail with the error: Value is not assignable to parameter
However as per the Prisma docs, strings are the intended method to provide default JSON values.
Unrelated to that, the generated Zod schemas for Typed JSON lists like fooList are missing z.array(...), the typescript types are correct
Environment (please complete the following information):
ZenStack version: 2.12.2
Prisma version: 6.4.x
Database type: Postgresql
Additional context
Raising a PR to address this shortly, just needed an issue number for the regression test :)
The text was updated successfully, but these errors were encountered:
Description and expected behavior
@default args on Typed JSON fields currently fail with the error:
Value is not assignable to parameter
However as per the Prisma docs, strings are the intended method to provide default JSON values.
Unrelated to that, the generated Zod schemas for Typed JSON lists like
fooList
are missingz.array(...)
, the typescript types are correctEnvironment (please complete the following information):
Additional context
Raising a PR to address this shortly, just needed an issue number for the regression test :)
The text was updated successfully, but these errors were encountered: