-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Prismabox doesn't add $id to schemas, except confusingly in the case of Where and WhereUnique.
https://github.com/m1212e/prismabox/blob/main/src/generators/where.ts#L272
https://github.com/m1212e/prismabox/blob/main/src/generators/where.ts#L87
I find that surprising because I would expect either the Plain or final Composite types to have and $id that is set to the prisma model name. Is this intentional? My suggestion would be for each model to have an $id that matches the generated typebox name (e.g. Model, ModelPlain, ModelWhere, ModelInputCreate, etc)
FYI - I have a post processing pass I'm using after prismabox runs, so I have a way to workaround the issues I'm opening (ranging from AST transforms to plain regex manipulation). I figure it's helpful to contribute some of that back to this repo where it makes sense, but I also don't want to be burdensome. I appreciate that this repo exists!