Closed
Description
Description and expected behavior
Schema:
enum FooType {
Bar
Baz
}
// Add JSON type field so a logical prisma client is generated.
// Polymorphic models also trigger this bug
type Meta {
test String?
}
model Foo {
id String @id @db.Uuid @default(uuid())
type FooType
meta Meta @json
@@validate(type == Bar, "FooType must be Bar")
}
Screenshots
The generated Zod Schema file for Foo
then contains an invalid import. .zenstack/models
is a .d.ts
file and contains no value exports.
Environment (please complete the following information):
- ZenStack version: 2.13.0
- Prisma version: 6.5.0
- Database type: Postgresql
Additional context
This bug doesn't occur when a logical client isn't generated. I believe the issue lies somewhere in this code, It doesn't really make sense to me that prismaClientPath
is being mapped to a definitions file?
zenstack/packages/schema/src/plugins/enhancer/index.ts
Lines 29 to 45 in 8a62f63
Metadata
Metadata
Assignees
Labels
No labels