Circular Dependency with Nestjs Swagger 4

The solution that worked for me was to declare in @ApiProperty() the type with arrow function, like below:

@Entity()
export class Job {
.
.
.
    @ManyToOne(type => Customer, customer => customer.jobs)
    @ApiProperty({ type: () => Customer })
    customer: Customer;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)