Skip to content

docs(calendar): fix finance_calendar date format and document per-date paging - #1344

Draft
hogan-yuan wants to merge 1 commit into
mainfrom
agent/T-0406-finance-calendar-end
Draft

hogan-yuan wants to merge 1 commit into
mainfrom
agent/T-0406-finance-calendar-end

Conversation

@hogan-yuan

Copy link
Copy Markdown
Member

Fixes the /v1/quote/finance_calendar reference reported in #1339.

API Reference (openapi.yaml)

  • date / date_end: YYYYMMDD → YYYY-MM-DD (the old format gets HTTP 400; SDK, CLI and MCP all send YYYY-MM-DD).
  • New query params: count, offset, next. New response field: next_date.
  • Paging behaviour as observed on 2026-11-23 (HK report):
    • count caps each date group; the group's count is the date's total.
    • offset pages inside one date (date=date_end=<date>&offset=<received>).
    • next_date moves past truncated dates.
    • date_end is not a hard upper bound (a 12-07..12-09 window returned groups up to 2027-02-05), so clients should filter by date <= date_end.

Calendar guide pages (en / zh-CN / zh-HK, 7 categories)

  • SDK parameter tables: count, offset, end and the response count now describe the same behaviour (they said "max events per page" / "skip from the start of the window").

Companion fixes: longbridge-terminal and longbridge-mcp now drop groups after end.

Test plan: content-only change; openapi.yaml parses (js-yaml). Site build not run here.

🤖 Noop (rust-maintainer) · AI agent acting for @hogan-yuan

…e paging

- openapi.yaml: `date` / `date_end` take `YYYY-MM-DD` (was `YYYYMMDD`, which the server rejects with HTTP 400).
- Document the `count`, `offset` and `next` query params and the `next_date` response field.
- Explain that `count` caps each date group, `offset` pages within one date, `next_date` moves past truncated dates, and `date_end` is not a hard upper bound.
- Apply the same corrections to the SDK parameter tables on the calendar pages (en / zh-CN / zh-HK).

Refs #1339

Agent: rust-maintainer
hogan-yuan added a commit to longbridge/longbridge-mcp that referenced this pull request Nov 23, 2026
…e count (#206)

`finance_calendar` now returns only dates within `start..end`, and each
date bucket carries `count`.

- **Window**: the upstream returns buckets after `date_end` (an HK
`report` window of 2026-12-07..2026-12-09 came back with buckets up to
2027-02-05). Those buckets are dropped, and full dates outside the
window are no longer re-paged by offset.
- **`count`**: each bucket now has `count`, the date's total for the
query. `infos` shorter than `count` means that date is incomplete. Added
to the output schema and tool description.

Before: `{list: [{date, infos}]}` · After: `{list: [{date, count,
infos}]}`

Reported in longbridge/developers#1339; docs fix in
longbridge/developers#1344.

Test plan
- [x] Unit tests: buckets outside the window are dropped; `count`
survives the merge (present only when upstream sent it)
- [x] CI (nightly fmt, clippy -D warnings, cargo test) green
- [ ] Call `finance_calendar` (category=report, market=HK,
start=2026-12-07, end=2026-12-09) against production after deploy

🤖 [Noop](https://huacnlee.github.io/noop) (rust-maintainer) · AI agent
acting for @hogan-yuan
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