fix(pilot): kiota client must send uncompressed JSON request bodies - #106
Merged
Conversation
The first live acceptance run of the kiota pilot failed on its very first create with a bare 400 and no explanation. The body was not the problem -- it serialises byte-for-byte to the shape the recorded probe evidence shows the API accepting -- the transport was: kiota-http-go's default middleware gzips every request body and sets Content-Encoding, and the ThousandEyes API refuses compressed bodies without saying so. The 400 carried no detail the client could surface because the spec declares no response body for POST /tags 400, so kiota has no error type to map it onto. The client now builds its adapter with the default middleware minus request compression, matching the wire behaviour every recording was gathered under, and a wire regression test pins the contract against a capture server: POST /v7/tags, Content-Type application/json, no Content-Encoding, the bearer header, and the exact JSON fields -- so the compression middleware coming back fails a unit test instead of a live tenant run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What happened
The first live run of the new
go | Acceptance tests (kiota)pipeline failed on its very first create:thousandeyes_tag→ bare 400 Bad Request, no detail.Diagnosis (fully offline)
{"accessType","key","objectType","value"}) — the body was not the problem.Content-Encoding: gzip), and the ThousandEyes API refuses compressed bodies with a bare 400. The resty pilot — and every committed recording — has always spoken plain JSON.POST /tags400, so kiota generates no error mapping for it — a spec gap, not a client bug.Fix
internal/clientbuilds its adapter with the default middleware set minus request compression (GetDefaultMiddlewaresWithOptions(NewCompressionOptionsReference(false))), with a comment recording why this is load-bearing. A new wire regression test (TestUnit_Client_SendsPlainJSONBodies) pins the contract against a capture server — method, path, bearer header,Content-Type: application/json, noContent-Encoding, and the exact JSON fields — so the compression middleware returning fails a unit test instead of a live tenant run.Verification
go | Acceptance tests (kiota)after merge to confirm against the live tenant.🤖 Generated with Claude Code