Repository navigation
fix: replay compares a recorded Accept, and allows one a recording lacks - #11
Merged
Merged
Conversation
Accept, like User-Agent, says what tool made a recording, not what a call asks for: go-api-libs/ibkr's newest recording was made by a tool sending Accept: application/json, which its generated client does not send, so the replay failed. Replay now compares headers but those two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
Rather than ignoring Accept, Replay compares it where the recording has it, and allows it where a recording made before clients sent it lacks it, through cassette's OptionalHeaders. A recording made with Accept: application/json, as go-api-libs/ibkr's newest, then matches a client that sends it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
MarkRosemaker/cassette#7 adds the OptionalHeaders Replay now uses; until it merges, cassette is pinned to its commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
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.
go-api-libs/ibkr's newest recording,
GET /iserver/accounts, was made by a tool that sendsAccept: application/json. ibkr's generated client sends noAccept, so its replay test fails:Rather than ignore
Accept, generated clients are to send it: openapi-codegen will send the media types an operation's responses declare (MarkRosemaker/openapi-codegen#86).Replaytherefore:Acceptwhere a recording has it, so ibkr's recording checks that its client acceptsapplication/json;It does both through cassette's
OptionalHeaders("Accept"), from MarkRosemaker/cassette#7, which has merged; cassette is bumped to its main.User-Agentis still ignored, since it names whatever tool made the recording. The doc comment says both.Test:
TestReplay's first case recordsGET /awithAccept: application/jsonand calls it with the same, and callsPOST /q, recorded withoutAccept, with one.make readypasses.🤖 Generated with Claude Code
https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y