Im using a fresh installation of nestjs with typeorm configure
and i use the following package https://github.com/woowabros/nestjs-library-crud
it generates the routes properly and swagger is fine. how ever when i try to create an entity im getting this error
here is my entity
import { IsOptional } from 'class-validator';
import {
Column,
CreateDateColumn,
DeleteDateColumn,
Entity,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
@Entity('apis')
export class API {
@IsOptional()
@PrimaryGeneratedColumn()
id: number;
@Column()
test: string;
@IsOptional()
@CreateDateColumn({ type: 'timestamptz' })
created_at: Date;
@IsOptional()
@UpdateDateColumn({ type: 'timestamptz' })
updated_at: Date;
@IsOptional()
@DeleteDateColumn({ type: 'timestamptz' })
deleted_at: Date;
}
I have configured validation pipe like so
app.useGlobalPipes(
new ValidationPipe({
forbidUnknownValues: false,
}),
);
{
"message": [
{
"target": {
"test": "test"
},
"children": [],
"constraints": {
"unknownValue": "an unknown value was passed to the validate function"
}
}
],
"error": "Unprocessable Entity",
"statusCode": 422
}