Skip to content

Handle String and Symbol keys consistently for client defaults - #53

Open
strzibny wants to merge 2 commits into
masterfrom
fix/string-symbol-keys
Open

strzibny wants to merge 2 commits into
masterfrom
fix/string-symbol-keys

Conversation

@strzibny

@strzibny strzibny commented Dec 2, 2026

Copy link
Copy Markdown
Contributor
  • Apply the client's symbolize_names default to JSON responses, including search_archive.
  • Convert param keys to Symbols before merging client defaults with call params, so an override given with the other key type replaces the default instead of both being sent.

Fixes #44
Fixes #45

Supersedes #46 and #47. rake test passes against the live API (80 examples).

strzibny and others added 2 commits December 2, 2026 14:54
Client.new(symbolize_names: false) is documented, but parse_json only
read the option from the call params, so the constructor value was
ignored. search_archive takes no params, so its responses always had
Symbol keys.

Fall back to the client default when the call doesn't set the option.

Fixes #44

Co-authored-by: Claude Opus 5.5 (xhigh effort) <noreply@anthropic.com>
String and Symbol keys are both accepted, but query merged the client
defaults and the search params as plain Hashes. A default given with
one key type and an override given with the other were both sent under
the same parameter name, and a nil override didn't remove the default.

Convert the keys of both Hashes to Symbols before merging. When one
Hash has both key types, the Symbol key wins, as it already did for
output. This replaces the output special cases in query and the
'engine' => nil workaround in extract. client.params still has the keys
given to the constructor.

Fixes #45

Co-authored-by: Claude Opus 5.5 (xhigh effort) <noreply@anthropic.com>
@strzibny
strzibny requested review from jvmvik and trusche December 2, 2026 14:18
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.

Mixed String and Symbol overrides send duplicate parameters Constructor symbolize_names defaults are ignored

1 participant