Sync the api client with the OpenAPI spec - #9815
Open
jhonabreul wants to merge 23 commits into
Open
jhonabreul wants to merge 23 commits into
jhonabreul wants to merge 23 commits into
Conversation
…alidate the paging window ReadBacktestOrders and ReadLiveOrders now return the OrdersResponseWrapper, whose Length holds the total order count, instead of only the page of orders, so callers can page through the whole collection. Both methods share the insights methods' window guard: a window larger than 100 throws and an end of 0 defaults to start + 100. Part of QuantConnect#9798
…ing window guard across the api methods ReadLiveOrders takes an optional algorithmId, documented in the API spec. The window guard used by the orders, insights and logs methods is now a single helper with a per-endpoint cap, the log line range defaults to a full window like its siblings, and the order json converter reads the documented stopTriggered, triggerTouched and trailingPercentage fields. Part of QuantConnect#9798
…nt filters to the live logs method ReadBacktestLog posts to backtests/read/log with the optional query keyword filter and the shared paging window guard. ReadLiveLogs now sends the documented query and deploymentLogs fields. The loopback stub server moves out of the orders test fixture so the new logs fixture can share it.
Adds ReadBacktestOrders, ReadLiveOrders, ReadBacktestLog, UpdateBacktestTags, CreateLiveCommand and ListObjectStore to the interface, widens ReadLiveLogs to the query and deploymentLogs arguments, and drops the explicit forwarding implementation that kept the old arity.
…and search the backtest log The backtest log endpoint accepts windows of up to 200 lines, unlike the live logs endpoint's 250, so it gets its own cap. The new credentialed tests run an algorithm that logs a numbered line per bar, page through the whole log with different window sizes, and search it with the query filter.
…share the same argument order
…alias no longer needs
…offline api fixtures with online tests Both order methods use the same 100 window cap and both log methods keep 200. The query parameter of the log methods documents an example. The loopback stub server and its offline fixtures are gone; the paged read guards, the default window and the log query are now covered by tests in the credentialed fixtures that CI runs.
…itional callers keep working
…ew overload ReadLiveOrders(projectId, algorithmId, start, end) mirrors ReadBacktestOrders. The previous signature stays as an obsolete forwarder so existing callers keep working.
jhonabreul
force-pushed
the
feature-api-client-audit
branch
from
September 21, 2026 21:06
1bf71ca to
1a0afb8
Compare
…orwarder, the return type already breaks callers
Adds the documented endpoints the client did not cover (file patch, project update, live auth0 read, the ai tools), the request and response members it was missing, fixes the mismatches with the documented request and response shapes, and aligns the IApi defaults with the class. Tests in the credentialed fixtures are still to be written.
One test or case per audited change in ProjectTests, LiveTradingTests, OptimizationTests and ObjectStoreTests, which CI runs with api credentials, plus unit tests for the rewritten live results converter.
…ositional callers keep working
… new overload ReadLiveInsights(projectId, algorithmId, start, end) mirrors ReadBacktestInsights. The previous signature stays as an obsolete forwarder so existing callers keep working.
jhonabreul
force-pushed
the
feature-api-client-audit
branch
from
September 21, 2026 21:27
1a0afb8 to
0017c64
Compare
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.
Description
Every endpoint of the QuantConnect OpenAPI spec was compared with
Apiand its models, and every difference fixed. Stacked on #9808, which should merge first.New endpoint methods:
UpdateProject,PatchProjectFileandReadBacktestLog, declared onIApias well.Missing members the client never sent or exposed:
codeSourceIdon the file methods,start/endonListProjects,parametersonCreateBacktest,projectIdonListLiveAlgorithms,algorithmIdonReadLiveInsights,queryanddeploymentLogson the log methods.Project.IsPinned/MaxFileSize/SharingTokenBacktest,Compile.Parameters,Backtest.Debugging,BacktestReport.Generating,ReadChartResponse.Status/Progress,OrdersResponseWrapper.Status/Progress,CreateLiveAlgorithmResponse.Live,LiveAlgorithmResults.Description/IsPublicStreaming, four fields onLiveAlgorithmSummary,BaseOptimization.Extremum,Optimization.TargetValue,ListObjectStoreResponse.Page/TotalPages.Mismatches with the documented request or response:
ReadBacktestInsightsposted to an undocumented path and never reached the endpoint; it now posts to the documented one.Card.LastFourDigitswas a decimal, dropping leading zeros; now a string.UpdateProjectFileNameandUpdateProjectFileContentdiscarded the returned files; they returnProjectFilesResponse.ReadBacktestReporttreated a report still generating as an empty success; it keeps polling whileGeneratingis set.SummaryObjectStore.IsFolderreadisFolderand never populated; the API sendsfolder.ReadLiveAlgorithmrequired adeployIdthe request does not; it is optional, and the results converter reads every field optionally and the errors from theerrorsarray.IApidefaults forListBacktestsandUpdateBacktestdiffered from the class, so calls through the interface sent different payloads; aligned.Left out on purpose: the project collaboration, brokerage authorization and AI tool endpoints.
Spec discrepancies: reviewers must verify
account/readdocuments no request body, but the client sendsorganizationIdto select an organization, and the spec has no organization endpoint at all. Kept.Project.parametersis documented as a name to value map; the API returns a list of name and value objects. Client kept.ReadBacktestChartRequestmarksstartandendrequired; the API treats them as optional and defaults to the full range. Client kept.backtests/tags/updateandBacktest.ServerStatisticsare undocumented but served. Kept, not obsoleted.BacktestSummary.SecurityTypesis a string in the client and an integer count in the spec. Kept.object/listfolder flag: the spec'sfolderwas confirmed against the real API; the oldisFolderwas wrong.Related Issue
#9798
Motivation and Context
The client had drifted from the documented API in ways that silently dropped data or never reached an endpoint.
Requires Documentation Change
Yes: the six items in the discrepancies section above are candidate spec fixes.
How Has This Been Tested?
All in the credentialed fixtures that the API tests workflow runs, for manual runs with api credentials:
ProjectTests: 13 tests, one per project, file, compile and backtest change, asserting the request sent or the documented member returned.LiveTradingTests: the live create summary, reading a live algorithm without a deploy id, and the project filter on the live list.OptimizationTestsandObjectStoreTests: one test each for the new optimization and listing members.LiveAlgorithmResultsJsonConverterTests: 4 unit tests for the converter, 8 in the suite passing.Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>