Skip to content

fix: json >= 3.0 is causing a wrong number of arguments - #427

Open
dominikschidlowskidmde wants to merge 1 commit into
hashicorp:masterfrom
dominikschidlowskidmde:fix/json-3-parse-arity
Open

dominikschidlowskidmde wants to merge 1 commit into
hashicorp:masterfrom
dominikschidlowskidmde:fix/json-3-parse-arity

Conversation

@dominikschidlowskidmde

Copy link
Copy Markdown

Summary

Fixes #426. json v3.0 changed JSON.parse's signature to keyword-only
arguments and removed the create_additions option entirely, so Client#success
and Client#error raise ArgumentError: wrong number of arguments (given 2, expected 1) on any successful or JSON-error response once json 3.x is
resolved.

Changes

  • JSON.parse(response.body, JSON_PARSE_OPTIONS)JSON.parse(response.body, **JSON_PARSE_OPTIONS)
    at the two call sites in lib/vault/client.rb.
  • Dropped create_additions: false from JSON_PARSE_OPTIONSjson 3.x
    removed the option outright. Not a behavior change: create_additions has
    defaulted to false for JSON.parse (as opposed to JSON.load) since at
    least v1.8.6.
  • Added unit coverage in spec/unit/client_spec.rb exercising #success/#error
    against a real JSON response body — the existing suite passed unchanged
    under json 3.0.2 even without this fix, since nothing drove a JSON-typed
    response through those methods.

@dominikschidlowskidmde
dominikschidlowskidmde requested a review from a team as a code owner September 14, 2026 13:02
@hashicorp-cla-app

hashicorp-cla-app Bot commented Sep 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

json >= 3.0 is causing a wrong number of arguments (given 2, expected 1)

1 participant