Skip to content

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

Merged
chrisarcand merged 1 commit into
hashicorp:masterfrom
dominikschidlowskidmde:fix/json-3-parse-arity
Oct 26, 2026
Merged

chrisarcand merged 1 commit into
hashicorp:masterfrom
dominikschidlowskidmde:fix/json-3-parse-arity

Conversation

@dominikschidlowskidmde

Copy link
Copy Markdown
Contributor

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_OPTIONS — json 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.

@butsjoh

butsjoh commented Sep 29, 2026

Copy link
Copy Markdown

Can we get an approval on this?

@dominikschidlowskidmde

Copy link
Copy Markdown
Contributor Author

@chrisarcand could ypu please have a look into this PR for this Issue: #426

@chrisarcand
chrisarcand force-pushed the fix/json-3-parse-arity branch from 62d04cc to 6eb7afd Compare October 26, 2026 20:49
@chrisarcand
chrisarcand merged commit dfc35fc into hashicorp:master Oct 26, 2026
26 checks passed
@chrisarcand

Copy link
Copy Markdown
Member

@dominikschidlowskidmde Thanks!

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)

3 participants