Expected Behavior
Perhaps we could add a new setting called 'preserveDecimal' to the library, which would allow users to choose how Decimal values are generated. By default, this setting would be set to false.
Example of output when it set to true:
@ApiProperty({ type: Number })
landSize: Prisma.Decimal;
I am proposing a solution to make all my DTO payloads type-safe by following Prisma includes. In the end it helps me to better document my APIs.
class UserDto extends IntersectionType(
PrismaModel.User,
PickType(PrismaModel.UserRelations, ['address','documents']),
)
implements
Prisma.UserGetPayload<{
include: typeof UserDto.include;
}>{
static get include() {
return Prisma.validator<Prisma.UserInclude>()({
address: true,
documents: true,
})
}
}
The Decimal type is generating as a number, which causes type incompatibilities. The temporary solution I have found so far is to ignore it:
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unreachable code error
If I find the time, I can work on this and suggest a solution.
Actual Behavior
The output is in number type:
@ApiProperty({ type: Number })
landSize: number;
Expected Behavior
Perhaps we could add a new setting called 'preserveDecimal' to the library, which would allow users to choose how Decimal values are generated. By default, this setting would be set to false.
Example of output when it set to true:
I am proposing a solution to make all my DTO payloads type-safe by following Prisma includes. In the end it helps me to better document my APIs.
The Decimal type is generating as a number, which causes type incompatibilities. The temporary solution I have found so far is to ignore it:
If I find the time, I can work on this and suggest a solution.
Actual Behavior
The output is in number type: