Description and expected behavior
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 :)