Skip to content

fix(fundamental): send comparison_symbols as a query array (gateway now accepts it) - #581

Open
hogan-yuan wants to merge 1 commit into
mainfrom
fix/valuation-comparison-symbols
Open

fix(fundamental): send comparison_symbols as a query array (gateway now accepts it)#581
hogan-yuan wants to merge 1 commit into
mainfrom
fix/valuation-comparison-symbols

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

背景

PR #562valuation_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串) ❌ 500
comparison_symbols=9988.HK&comparison_symbols=3690.HK(重复键) ✅ 200
comparison_symbols[]=...(方括号) ✅ 200

改动

  • 删除 stopgap(symbol_to_counter_id shim + comparison_counter_ids 本地转换)
  • Query 字段改为 comparison_symbols: Option<Vec<String>>,由 qs 序列化成重复键 —— 正好匹配网关
  • 公开 API 签名不变(一直是 Option<Vec<String>> 用户符号)

验证

  • cargo clippy --all --all-features 0 error,cargo +nightly fmt 干净
  • 测试环境真实 SDK:700.HK + 2/3/4 个对比标的,返回标的本身 + 全部对比标的,symbol 均为用户符号 ✅

⚠️ 发布顺序

网关修复目前只在测试环境;生产对新格式仍返回 code 13(旧参数 comparison_counter_ids 仍正常)。本 PR 需等网关生产部署上线后再合并/发版,否则生产带对比标的的 valuation_comparison 会失败。

🤖 Generated with Claude Code

…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.
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.

1 participant