Skip to content

feat: match an optional header recorded with fewer values - #8

Closed
MarkRosemaker wants to merge 1 commit into
mainfrom
feat/optional-header-more-values
Closed

MarkRosemaker wants to merge 1 commit into
mainfrom
feat/optional-header-more-values

Conversation

@MarkRosemaker

Copy link
Copy Markdown
Owner

Generated clients build Accept from the media types of their responses. When a recording teaches a client a new media type, the client sends more than the Accept that was recorded with that same call. yahoo-finance's new 502 recording is an example: its text/html error page means the client now sends application/json, text/html, while the recording has application/json. Replay therefore stopped matching the very recording that taught the client the new type.

With this change, an OptionalHeaders header recorded with a comma-separated list also matches a request that sends every recorded value plus more. A request that drops a recorded value still fails to match. apitest already applies OptionalHeaders("Accept"), so libraries only need the bump.

I checked yahoo-finance against this branch, and its replay test passes again.

make ready passes.


Generated by Claude Code

A client builds Accept from the media types of its responses, so once a
recording teaches it a new one, such as an error page's text/html, it
sends more than the Accept recorded with that very call, and replay no
longer matched it. An optional header recorded with a comma-separated
list now matches a request that sends every value of it, and more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y

Copy link
Copy Markdown
Owner Author

Closing this unmerged. Clients are dropping Accept (MarkRosemaker/openapi-codegen#92) and replay is ignoring it (go-api-libs/api#12), so this matching rule is no longer needed.


Generated by Claude Code

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.

2 participants