Skip to content

Comments

Refactor/#115 쿼리파라미터 수정#116

Merged
y-eonee merged 1 commit intodevelopfrom
refactor/#115-쿼리파라미터수정
Jan 20, 2026

Hidden character warning

The head ref may contain hidden characters: "refactor/#115-\ucffc\ub9ac\ud30c\ub77c\ubbf8\ud130\uc218\uc815"
Merged

Refactor/#115 쿼리파라미터 수정#116
y-eonee merged 1 commit intodevelopfrom
refactor/#115-쿼리파라미터수정

Conversation

@y-eonee
Copy link
Contributor

@y-eonee y-eonee commented Jan 20, 2026

🔗 연결된 이슈

📄 작업 내용

  • 쿼리파라미터 String -> Any로 변경했습니다.

@y-eonee y-eonee requested a review from a team January 20, 2026 03:17
@y-eonee y-eonee self-assigned this Jan 20, 2026
@y-eonee y-eonee requested review from soseoyo12, sum130 and wotjs020708 and removed request for a team January 20, 2026 03:17
@y-eonee y-eonee added 나연🐹 Refactor 코드 리팩토링 시 사용 labels Jan 20, 2026
@y-eonee y-eonee linked an issue Jan 20, 2026 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

EndPoint 프로토콜의 queryParameters 속성 타입을 [String: String]?에서 [String: Any]?로 변경하고, URL 생성 로직을 String(describing:)을 이용한 값 변환으로 업데이트했습니다.

Changes

개념 / 파일 변경 사항
네트워크 엔드포인트 쿼리 파라미터
Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/EndPoint.swift
쿼리 파라미터 속성 타입을 [String: String]?에서 [String: Any]?로 변경하고, URL 생성 시 String(describing:)을 통한 값 직렬화 로직 추가

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 쿼리파라미터 수정이라는 변경사항과 관련이 있으며, 링크된 이슈 #115를 명확히 참조하고 있습니다.
Description check ✅ Passed PR 설명은 쿼리파라미터 타입을 String에서 Any로 변경한 작업 내용을 명확히 설명하고 있으며, 연결된 이슈와 관련성이 있습니다.
Linked Issues check ✅ Passed PR 변경사항은 이슈 #115의 목적인 쿼리파라미터 타입을 String에서 Any로 변경하는 요구사항을 충족하고 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항은 EndPoint.swift의 queryParameters 타입 변경으로 제한되어 있으며, 이슈 #115의 범위 내에 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 refactor/#115-쿼리파라미터수정

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

🤖 Fix all issues with AI agents
In `@Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/EndPoint.swift`:
- Around line 48-51: EndPoint에서 URLQueryItem을 만들 때 String(describing: $0.value)로
Optional을 그대로 문자열화하면 "Optional(...)" 또는 "nil"이 전송되니, Optional을 안전하게 처리하도록 변경하세요:
파라미터 딕셔너리에서 nil 값을 필터링(compactMap)하거나 각 값에 대해 value.map { String($0) } 또는
"\(unwrapped)" 방식으로 언래핑한 문자열을 사용해 URLQueryItem(name: $0.key, value:
unwrappedString)으로 생성하도록 수정을 적용(참조심볼: URLQueryItem, $0.key, $0.value,
EndPoint.swift).

Comment on lines +48 to +51
URLQueryItem(
name: $0.key,
value: String(describing: $0.value)
)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

String(describing:)의 Optional 처리 동작에 주의하세요

String(describing:)은 Optional 값을 전달받으면 "Optional(123)" 또는 "nil" 형태의 문자열을 생성합니다. 이로 인해 예상치 못한 쿼리 스트링이 서버로 전송될 수 있습니다.

예시:

let value: Int? = 123
String(describing: value) // "Optional(123)" ❌
"\(value!)"               // "123" ✅ (단, 강제 언래핑 필요)
🛠️ Optional 안전 처리를 위한 수정 제안
         if let queryParameters {
-            urlComponents.queryItems = queryParameters.map {
-                URLQueryItem(
-                    name: $0.key,
-                    value: String(describing: $0.value)
-                )
-            }
+            urlComponents.queryItems = queryParameters.compactMap { key, value in
+                if case Optional<Any>.none = value {
+                    return nil
+                }
+                let stringValue: String
+                if let optional = value as? any OptionalProtocol {
+                    stringValue = optional.wrappedDescription
+                } else {
+                    stringValue = "\(value)"
+                }
+                return URLQueryItem(name: key, value: stringValue)
+            }
         }

또는 더 간단하게 "\($0.value)"를 사용하되, 호출하는 쪽에서 Optional이 아닌 값만 전달하도록 문서화하는 방법도 있습니다:

-                    value: String(describing: $0.value)
+                    value: "\($0.value)"
🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/EndPoint.swift` around lines
48 - 51, EndPoint에서 URLQueryItem을 만들 때 String(describing: $0.value)로 Optional을
그대로 문자열화하면 "Optional(...)" 또는 "nil"이 전송되니, Optional을 안전하게 처리하도록 변경하세요: 파라미터
딕셔너리에서 nil 값을 필터링(compactMap)하거나 각 값에 대해 value.map { String($0) } 또는
"\(unwrapped)" 방식으로 언래핑한 문자열을 사용해 URLQueryItem(name: $0.key, value:
unwrappedString)으로 생성하도록 수정을 적용(참조심볼: URLQueryItem, $0.key, $0.value,
EndPoint.swift).

Copy link
Contributor

@wotjs020708 wotjs020708 left a comment

Choose a reason for hiding this comment

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

빠른 PR 감사합니다!

Copy link
Contributor

@soseoyo12 soseoyo12 left a comment

Choose a reason for hiding this comment

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

수고하셨습니당

Copy link
Contributor

@sum130 sum130 left a comment

Choose a reason for hiding this comment

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

어푸푸 드립니다!!!👍

@y-eonee y-eonee merged commit 80796f9 into develop Jan 20, 2026
1 check passed
@y-eonee y-eonee deleted the refactor/#115-쿼리파라미터수정 branch January 20, 2026 04:35
Kimgyuilli pushed a commit that referenced this pull request Jan 21, 2026
y-eonee added a commit that referenced this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor 코드 리팩토링 시 사용 나연🐹

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 쿼리파라미터 String -> Any 변경

4 participants