When I set imports = null, will generate unnecessary import import * as imports from "../../prisma/null".
generator zod {
provider = "nestjs-zod-prisma"
output = "../src/schemas" // (default) the directory where generated zod schemas will be saved
relationModel = true // (default) Create and export both plain and related models.
// relationModel = "default" // Do not export model without relations.
// relationModel = false // Do not generate related model
generateDto = true // (default) Generate DTOs for NestJS
modelCase = "PascalCase" // (default) Output models using pascal case (ex. UserModel, PostModel)
// modelCase = "camelCase" // Output models using camel case (ex. userModel, postModel)
modelSuffix = "Model" // (default) Suffix to apply to your prisma models when naming Zod schemas
dtoCase = "PascalCase" // (default) Output DTOs using pascal case (ex. UserDto, PostDto)
// dtoCase = "camelCase" // Output DTOs using camel case (ex. userDto, postDto)
dtoSuffix = "Dto" // (default) Suffix to apply to your prisma models when naming DTOs
// useDecimalJs = false // (default) represent the prisma Decimal type using as a JS number
useDecimalJs = true // represent the prisma Decimal type using Decimal.js (as Prisma does)
imports = null // (default) will import the referenced file in generated schemas to be used via imports.someExportedVariable
// https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values
prismaJsonNullability = true // (default) uses prisma's scheme for JSON field nullability
// prismaJsonNullability = false // allows null assignment to optional JSON fields
}
import * as z from "nestjs-zod/z"
import { createZodDto } from "nestjs-zod/dto"
import * as imports from "../../prisma/null" // what is this null ????
import { CompleteUser, RelatedUserModel } from "./index"
export const ApiTokenModel = z.object({
id: z.string(),
userId: z.string(),
created: z.date(),
token: z.string(),
expired: z.date().nullish(),
name: z.string(),
})
export class ApiTokenDto extends createZodDto(ApiTokenModel) {
}
export interface CompleteApiToken extends z.infer<typeof ApiTokenModel> {
user: CompleteUser
}
/**
* RelatedApiTokenModel contains all relations on your model in addition to the scalars
*
* NOTE: Lazy required in case of potential circular dependencies within schema
*/
export const RelatedApiTokenModel: z.ZodSchema<CompleteApiToken> = z.lazy(() => ApiTokenModel.extend({
user: RelatedUserModel,
}))
When I set
imports = null
, will generate unnecessary importimport * as imports from "../../prisma/null"
.