Skip to content

Roll out codegen registry to all client classes (#114)#115

Merged
martinkersner merged 5 commits into
mainfrom
issue-114-roll-out-codegen-registry
Jul 1, 2026
Merged

Roll out codegen registry to all client classes (#114)#115
martinkersner merged 5 commits into
mainfrom
issue-114-roll-out-codegen-registry

Conversation

@martinkersner

@martinkersner martinkersner commented Jul 1, 2026

Copy link
Copy Markdown
Member

Closes #114

Converts remaining client methods off hardcoded /api/v… paths onto self.request_endpoint("<op_id>", **wire_params), single-sourcing path/method/path-query split/defaults from the generated _endpoints.py.

Validation policy (settled)

Each class keeps its own semantic + required checks unchanged (check_required_parameter(s), market ∈ [spot,futures], sort ∈ [asc,desc], currency/type enums, "no data found", DataFrame shaping). request_endpoint only owns path/method/split/defaults + a spec-driven required backstop. No error messages or behavior changed; existing tests pass unmodified.

Converted (fully)

  • forex, naver, telegram
  • cex_fee, cex_ticker, cex_wallet_status
  • cex_announcement
  • liquidation (all), open_interest (all)
  • funding_rate: history, exchanges, symbols
  • cex_symbol: metadata, tags, oi, oi_stats, liquidation
  • premium: exchanges

Left on hardcoded paths — registry/openapi.yaml gaps (would break pinned wire contracts)

  • funding_rate.latest — registry funding_rate_latest lacks sort+limit (class supports them).
  • cex_token.updates — registry cex_token_updates lacks sort (test pins sort=desc on wire).
  • cex_symbol.cautions / delistings — registry lacks base (class sends it).
  • cex_symbol.volume — registry cex_symbol_volume lacks exchange (test pins exchange on wire).
  • premium.__call__ — registry premium uses snake_case wire keys (source_exchange) but class/test pin camelCase (sourceExchange), and registry lacks ~40 min/max/funding filter params the class sends.

These need upstream datamaxi-codegen / openapi.yaml fixes before conversion; filed as follow-ups.

Test plan

  • pytest -m "not integration": 113 passed, 11 skipped, 116 deselected.
  • black --check + flake8 on datamaxi/ + tests/: clean.
  • grep for /api/v in datamaxi/**.py (excluding _endpoints.py + doc-link comments/URLs): only the 5 registry-gap methods above remain.

@martinkersner martinkersner self-assigned this Jul 1, 2026
@martinkersner martinkersner merged commit 818bb8d into main Jul 1, 2026
7 checks passed
@martinkersner martinkersner deleted the issue-114-roll-out-codegen-registry branch July 1, 2026 04:04
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.

Roll out codegen registry (_endpoints.py) to all client classes

1 participant