fix: /ranking/me 500 에러 수정 (@UserId 리졸버 primitive long 미인식) - #249
Merged
Conversation
UserIdResolver#supportsParameter가 boxed java.lang.Long만 매칭하는데, Kotlin의 non-null Long은 바이트코드상 primitive long으로 컴파일되어 리졸버가 파라미터를 인식하지 못하고 있었음. nullable(Long?)로 선언해 boxed Long으로 컴파일되게 수정.
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업 배경
GET /api/course/{courseId}/ranking/me가 500을 반환하는 걸 발견원인
UserIdResolver#supportsParameter는Long.class.equals(parameter.getParameterType())로 boxedjava.lang.Long만 매칭하는데, Kotlin 컨트롤러의@UserId userId: Long(non-null)은 바이트코드상 primitivelong으로 컴파일되어 리졸버가 파라미터를 인식하지 못함. 그 결과 토큰 검증 로직(NullAccessTokenException등)을 타지 않고 엉뚱하게 500으로 떨어짐.변경 사항
@UserId userId: Long?(nullable)로 선언해 boxedLong으로 컴파일되게 수정requireNotNull(userId)사용 (!!대신)검증
🤖 Generated with Claude Code