티스토리 뷰
라이브러리, 프레임워크/Swagger
[Swagger + NestJS] A circular dependency has been detected 에러
dv_jamie 2022. 7. 20. 12:58에러메시지
A circular dependency has been detected (property key: "replies"). Please, make sure that each side of a bidirectional relationships are using lazy resolvers ("type: () => ClassType").
해결
에러메시지 (property key: "replies") 를 참고해 replies를 사용하는 entity 파일을 찾아서 아래와 같이 추가해줬다.
// user.entity.ts
@ApiProperty({
type: () => Reply // --> 이 부분 추가
})
@IsInt()
@OneToMany((type) => Reply, (reply) => reply.writer)
replies: Reply;
'라이브러리, 프레임워크 > Swagger' 카테고리의 다른 글
[Swagger + NestJS] PickType 이용 시 @ApiProperty 적용 안되는 문제 (0) | 2022.07.06 |
---|---|
[Swagger + NestJS] 사용 예시 (0) | 2022.06.16 |
[Swagger + NestJS] 초기 세팅 (0) | 2022.06.15 |
댓글