Repository navigation
Conversation
String and Symbol keys are accepted for request parameters, but merging them as distinct Hash keys sends both defaults and overrides under the same HTTP field name. Remove a default when its opposite key type is present in the call. Preserve actual key objects, payload values, output precedence, and nil compaction. Fixes serpapi#45
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 this does
Remove constructor defaults whose String/Symbol counterpart is present
in the call before merging. Keys and values are preserved rather than
globally normalized. This extends the existing output-key override
precedent to normal request parameters.
Nine regressions fail on the base: both key directions for engines,
API keys, and unknown backend options, plus nil removal, array replacement,
and multipart API-key replacement. Eight guards cover untouched defaults,
output precedence, and forced Extract/HTML/Markdown parameters.
The fix does not mutate input Hashes or multipart IOs, add dependencies,
change error handling, or resolve ambiguous duplicate spellings within
a single call. Existing output precedence and nil compaction are retained.
No live fixture needs re-recording: the tests serialize requests without
sending them. Existing docs already promise per-call overrides, so the
only documentation change is a changelog entry.
Open #39 and #42 remain separate. Their current patches apply alongside
this fix and the separate fix for #44.
Type of change
Scope check
Related issue
Fixes #45
Quality check
bundle exec rake lint, 9 files, zero offenses (no project hooks configured)Focused/regression/compatibility harnesses block network access.
The mocked specs used only an invalid non-secret placeholder to pass
the global API-key guard. No coverage-completeness claim is made.
Ownership
API changes