HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🧑🏻‍💻
박진형
/
🌲
Resume - 형욱 (1)
/
🤔
프로젝트 자세히보기
/
🖼️
프로젝트 관리
/
Custom @AuthenticationPrincipal 스웨거 명세되는 문제

Custom @AuthenticationPrincipal 스웨거 명세되는 문제

상태
해결
날짜
Sep 14, 2022 11:30 AM
태그
백엔드
생성자

문제

@AuthenticationPrincipal을 커스텀한 @AuthUser 어노테이션을 추가하고 사용한 후 스웨거 명세에 @AuthUser 객체가 명세되는 문제가 발생했습니다.
 
notion image
 

해결

Swagger의 기본 설정에는 @AuthenticationPrincipal 이라는 어노테이션을 기본적으로 Ignore하는 설정을 갖고 있었습니다.
notion image
 
하지만 새로만든 @AuthUser어노테이션은 Ignore 설정이 되지 않았기 때문인데요.
다음과 같은 설정을 추가해서 해결할 수 있었습니다.
notion image