Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.
The below schema passes the ZenStack CLI, but the generated Prisma schema fails validation:
Error: Prisma schema validation - (get-dmmf wasm)
Error code: P1012
error: Error validating field `posts` in model `User`: The relation field `posts` on model `User` is missing an opposite relation field on the model `Post`. Either run `prisma format` or add it manually.
model User {
id String @id @default(cuid())
name String?
content Content[]
post Post[]
}
model Content {
id String @id @default(cuid())
published Boolean @default(false)
contentType String
@@delegate(contentType)
user User @relation(fields: [userId], references: [id])
userId String
}
model Post extends Content {
title String
}
model Image extends Content {
url String
}
The below schema passes the ZenStack CLI, but the generated Prisma schema fails validation: