Skip to content

Add APIHelper.mapValuesToQueryDictionary query-item helper#61

Merged
laevandus merged 4 commits into
developfrom
add-open-api-query-item-helper
Jul 9, 2026
Merged

Add APIHelper.mapValuesToQueryDictionary query-item helper#61
laevandus merged 4 commits into
developfrom
add-open-api-query-item-helper

Conversation

@laevandus

@laevandus laevandus commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔗 Issue Links

  • CHA-3808
  • Consumer PR: GetStream/chat#14602

🎯 Goal

Generated Swift endpoints serialized nil query params as the literal string <null> (e.g. ?limit=<null>) instead of omitting them from the URL.

📝 Summary

  • Add APIHelper.mapValuesToQueryDictionary(_ source: [String: Any?]) -> [String: String]? — drops nil-valued keys and comma-joins collection values.
  • Add unit tests: nil optionals dropped, Bool"true"/"false", [String] → CSV, empty/all-nil → nil.

🛠 Implementation

The chat OpenAPI Swift generator (GetStream/chat#14602) wraps generated queryItems dicts in this helper, passing scalars and [String] raw. [String: Any?] (not [String: Any]) preserves optionality so nil detection works via filter { $0.value != nil }; the [String: String]? return type conforms to Encodable & Sendable for Endpoint.queryItems. The existing mapValuesToQueryItems overloads are left untouched.

🎨 Showcase

N/A

🧪 Manual Testing Notes

N/A

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

Maps [String: Any?] to [String: String]?, dropping nil-valued keys and comma-joining collections. Used by the chat OpenAPI Swift generator so absent query params are omitted from the URL instead of serialized as "<null>". Existing mapValuesToQueryItems overloads are unchanged.
@laevandus laevandus requested a review from a team as a code owner July 9, 2026 11:34
@laevandus laevandus enabled auto-merge (squash) July 9, 2026 11:37
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
1 Error
🚫 Please start subject with capital letter.
d23d6e1

Generated by 🚫 Danger

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@laevandus laevandus merged commit e34953a into develop Jul 9, 2026
7 of 9 checks passed
@laevandus laevandus deleted the add-open-api-query-item-helper branch July 9, 2026 14:17
Copilot stopped work on behalf of martinmitrevski due to an error July 9, 2026 14:17
Copilot AI requested a review from martinmitrevski July 9, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants