Skip to content

Conversation

@wjdrjs00
Copy link
Member

@wjdrjs00 wjdrjs00 commented Nov 22, 2025

[ PR Content ]

Related issue

Screenshot 📸

스크린샷 2025-11-22 22 55 24

Work Description

  • 도로명 주소 -> 지번 주소로 변경

To Reviewers 📢

  • api 문서를 읽어보니 도로명 주소는 null 값이 오는 경우가 있다고 하더군요,,,! 해서 안전하게 지번주소를 사용하도록 수정했습니다.

Summary by CodeRabbit

  • 버그 수정
    • 좌표에서 주소로 변환하는 기능에서 주소 정보 추출 방식을 개선했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

도로명 주소 -> 주소로 변경
@wjdrjs00 wjdrjs00 requested a review from l5x5l November 22, 2025 14:01
@wjdrjs00 wjdrjs00 self-assigned this Nov 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 22, 2025

개요

Coord2AddressResponse.toAddress() 메서드의 주소 추출 로직이 변경되었습니다. 기존 RoadAddressaddressName을 참조하던 방식에서 첫 번째 문서의 Address에서 직접 addressName을 반환하도록 수정되었습니다. 공개 API나 함수 서명에는 변경이 없습니다.

변경 사항

코호트 / 파일 변경 요약
주소 응답 모델 수정
data/src/main/java/com/threegap/bitnagil/data/address/model/response/Coord2AddressResponse.kt
toAddress() 메서드의 주소 추출 경로 변경: documents[0].roadAddress?.addressNamedocuments[0].address.addressName로 수정. 도로 위치에서 road_address가 null인 경우에도 address 필드의 주소명을 정상적으로 반환하도록 개선

예상 코드 리뷰 소요 시간

🎯 1 (단순) | ⏱️ ~5분

  • 추가 검토 사항:
    • 변경된 필드 접근이 모든 응답 시나리오(도로 위치, 건물 내 위치)에서 유효한지 확인
    • address 필드의 null 체크 필요 여부 검토
    • 기존 RoadAddress 참조 제거의 부작용 여부 확인

축하 시

🐰 도로 위의 주소도 이제 척척 찾아내고,
건물 안팎 가릴 것 없이 모두 응답해,
버그 사냥꾼의 재기발랄한 손길로
위치 기반 기능이 더욱 견고해졌네! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주소 변환 시 도로명 주소가 null인 문제 해결이라는 주요 변경 사항을 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 관련 이슈, 스크린샷, 작업 설명, 리뷰어 안내 등 템플릿의 필수 섹션을 모두 포함하고 있습니다.
Linked Issues check ✅ Passed 코드 변경이 이슈 #152의 요구사항을 충족합니다. RoadAddress가 null인 경우 지번 주소(Address)를 사용하도록 수정하여 도로 위치에서도 주소를 정상적으로 로드할 수 있게 되었습니다.
Out of Scope Changes check ✅ Passed 변경사항이 Coord2AddressResponse.toAddress() 메서드의 주소 추출 로직만 수정하여 이슈 #152의 범위 내에 있으며, 범위를 벗어난 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#152-location-api

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
data/src/main/java/com/threegap/bitnagil/data/address/model/response/Coord2AddressResponse.kt (1)

21-26: roadAddress 필드의 nullable 처리가 필수입니다.

API가 road_address: null을 반환할 수 있으며 이슈 #152에서 확인되었습니다. 그러나 23번 라인에서 roadAddress가 non-nullable로 선언되어 있어, kotlinx.serialization이 null 값을 역직렬화할 때 SerializationException이 발생합니다. 이는 toAddress() 함수가 실행되기 전에 네트워크 응답 파싱 단계에서 발생합니다.

현재 toAddress() 함수가 address 필드를 사용하도록 수정된 것은 좋지만, 이는 null 문제가 있는 필드를 사용하지 않는 우회책일 뿐 근본적인 역직렬화 오류를 막지는 못합니다.

다음 diff를 적용하여 roadAddress를 nullable로 변경하세요:

 @Serializable
 data class Document(
     @SerialName("road_address")
-    val roadAddress: RoadAddress,
+    val roadAddress: RoadAddress?,
     @SerialName("address")
     val address: Address,
 )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae7206f and c12396c.

📒 Files selected for processing (1)
  • data/src/main/java/com/threegap/bitnagil/data/address/model/response/Coord2AddressResponse.kt (1 hunks)

Copy link
Contributor

@l5x5l l5x5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wjdrjs00 wjdrjs00 merged commit c3ae2f4 into develop Nov 22, 2025
2 checks passed
@wjdrjs00 wjdrjs00 deleted the fix/#152-location-api branch November 22, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 제보하기 중 신고 위치 선택시 도로위에 있을 경우 주소 불러오기가 안되는 문제

3 participants