fix: serialize nested query dictionaries with bracket notation - #59
Conversation
Query values that were dictionaries or lists were sent through ToString(), producing garbage for a date range (Dictionary.ToString()) and for arrays (List.ToString()). Recurse into IDictionary values expanding them to bracket keys (date[gte]=...&date[lt]=...), expand non-string enumerables to repeated empty-bracket keys (status[]=...), and keep null values serialized as empty (foo=), matching the v2 API contract. Bump to 6.8.1 and add a regression test.
SearchResult gains TotalsAreCapped, NextCursor, and PreviousCursor so callers can follow cursor pagination and detect capped totals once the capping wave is live (page totals capped; cursor mode returns totals only on the first page).
The nested query serialization fix is a patch, but the new cursor and capped-total properties on SearchResult are additive public API, so the release is a minor per semver, consistent with the node SDK bump.
SearchResult cursor/capped metadata under Added; nested query param serialization fix under Fixed.
- SearchResult.Page/TotalPages/TotalResults are now nullable: later cursor pages omit them and deserializing absence as 0 misreported metadata. - Regression tests: a later-cursor response (only cursors + data) maps to null totals, and array params serialize to repeated bracket keys (status[]=valid&status[]=canceled), covering the IEnumerable branch.
Changing Page/TotalPages/TotalResults from int to int? alters public member signatures, so the release is a major (7.0.0), with the additive cursor/capped metadata under Added and the serialization fix under Fixed.
|
Semver atendido en 38be2c5: al cambiar int → int? (firmas públicas) el release pasa a 7.0.0 (major), con CHANGELOG [7.0.0] (Breaking + Added + Fixed) y el body actualizado. |
There was a problem hiding this comment.
🟡 Changes recommended
The changelog incorrectly duplicates the release changes under version 6.9.0.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
|
Corregido en d684018: se eliminó la sección [6.9.0] duplicada del CHANGELOG; todo el trabajo se libera una sola vez como 7.0.0. |
|
One more commit: lists now serialize as repeated keys ( |
Cambios (7.0.0)
Breaking
SearchResult.Page/TotalPages/TotalResultsahora sonint?(las páginas de cursor posteriores omiten totales; la ausencia ya no se deserializa como0).Added
SearchResultexponeTotalsAreCapped,NextCursor,PreviousCursor.Fixed
date[gte]=...&date[lt]=...) y arrays astatus[]=....El cambio
int→int?altera firmas públicas, por lo que se libera como 7.0.0 (major); CHANGELOG[7.0.0]incluido.