fix(fundamental): send comparison_symbols as a query array (gateway now accepts it) - #581
Open
hogan-yuan wants to merge 1 commit into
Open
fix(fundamental): send comparison_symbols as a query array (gateway now accepts it)#581hogan-yuan wants to merge 1 commit into
hogan-yuan wants to merge 1 commit into
Conversation
…ow accepts it) The gateway now supports the comparison_symbols parameter on GET /v1/quote/compare/valuation, expecting a standard HTTP array (repeated keys: comparison_symbols=A&comparison_symbols=B), not a JSON array string. Drop the temporary stopgap that converted the peer symbols to counter-ids and sent the legacy comparison_counter_ids parameter; pass the user symbols straight through as Option<Vec<String>>, which the qs serializer emits as repeated keys. Removes the symbol_to_counter_id shim added for the stopgap. Verified live on staging (2/3/4 peers return the stock plus all peers). Note: the gateway fix is on staging first; production still answers this new format with code 13 until its rollout lands.
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.
背景
PR #562 把
valuation_comparison的请求参数从comparison_counter_ids改成comparison_symbols,但当时网关未支持,故加了临时 stopgap(SDK 本地把 symbol 转回 counter_id、继续发旧参comparison_counter_ids)。现在
网关已支持
comparison_symbols,但认的是标准 HTTP 数组格式(重复键comparison_symbols=A&comparison_symbols=B或[]),不是 JSON 数组串。实测:comparison_symbols=["9988.HK","3690.HK"](JSON串)comparison_symbols=9988.HK&comparison_symbols=3690.HK(重复键)comparison_symbols[]=...(方括号)改动
symbol_to_counter_idshim +comparison_counter_ids本地转换)comparison_symbols: Option<Vec<String>>,由 qs 序列化成重复键 —— 正好匹配网关Option<Vec<String>>用户符号)验证
cargo clippy --all --all-features0 error,cargo +nightly fmt干净网关修复目前只在测试环境;生产对新格式仍返回 code 13(旧参数
comparison_counter_ids仍正常)。本 PR 需等网关生产部署上线后再合并/发版,否则生产带对比标的的valuation_comparison会失败。🤖 Generated with Claude Code