Sync the api client with the OpenAPI spec - #9815
Open
jhonabreul wants to merge 17 commits into
Open
jhonabreul wants to merge 17 commits into
jhonabreul wants to merge 17 commits into
Conversation
jhonabreul
force-pushed
the
feature-api-client-audit
branch
2 times, most recently
from
September 21, 2026 21:27
1a0afb8 to
0017c64
Compare
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 22, 2026 15:01
0017c64 to
cdf7bc1
Compare
…the one that sends it, and assert the fields the api actually populates
… compile parameters list the api sends
…e api serves them
…blic streaming members, which only serve the web terminal
…nly serves the web terminal
…lgorithm id against a second deployment
… duplicate the criterion
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:
UpdateProjectandReadBacktestLog, declared onIApias well.Missing members the client never sent or exposed:
start/endonListProjects,parametersonCreateBacktest,projectIdonListLiveAlgorithms,algorithmIdonReadLiveInsights,queryanddeploymentLogson the log methods.Project.MaxFileSize,Backtest.Debugging,BacktestReport.Generating,ReadChartResponse.Status/Progress,OrdersResponseWrapper.Status/Progress,CreateLiveAlgorithmResponse.Live,LiveAlgorithmResults.Description,LiveAlgorithmSummary.Equity/Environment/Description,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.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 document and the server ignores; it is gone, 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; the
Project.isPinned,Project.sharingTokenBacktest,LiveAlgorithmSummary.leaguesandLiveAlgorithmResults.isPublicStreamingmembers and thecodeSourceIdrequest field of the file methods, which serve the web terminal rather than a user or an LLM; and, until the API serves them, the file patch endpoint and the compile parameters.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.CreateOptimizationResponse.extremumis documented on the create and list responses, but onlyoptimizations/readsends it; create and list only carry it insidecriterion. Client reads it on the read model only.Optimization.extremumandtargetValueat the top level duplicatecriterion, which the client already maps; not added.targetValuecomes back null even when set on create.CreateCompileResponse.parametersis always empty on create, before the build runs, andcompile/readdoes not carry it at all. Left out of the client until the API serves it.files/patchanswers success without applying the patch. Left out of the client until the API applies it.files/updateis documented to answer with the updated files; the API answers with a plain rest response. Client 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: 10 tests, one per project, file and backtest change, asserting the request sent or the documented member returned.ReadLiveInsightsWorksAsExpectednow deploys twice: thealgorithmIdreads one deployment, and omitting it reads every deployment of the project together.LiveTradingTests: the live create summary, reading the latest live deployment, and the project filter on the live list.ObjectStoreTests: one test for the new listing members.LiveAlgorithmResultsJsonConverterTests: 4 unit tests for the converter, 8 in the suite passing.Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>