hashicorp / hashicorp/vault-ruby
json >= 3.0 is causing a wrong number of arguments (given 2, expected 1)
- Dominant language
- Ruby
- Stars
- 354
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
Recently JSON gem v3.0.0 was released. https://github.com/ruby/json/releases/tag/v3.0.0
We since have an error calling the vault library: wrong number of arguments (given 2, expected 1)
```
~# gem list json
*** LOCAL GEMS ***
json (3.0.2, 3.0.0, 2.21.2, 2.19.9, default: 2.6.1)
multi_json (1.19.1)
```
```
irb(main):001:0> require "vault"
=> true
irb(main):002:1* Vault.configure do |config|
irb(main):003:1* config.address = "https://localhost:8200"
irb(main):004:1* config.ssl_verify = false
irb(main):005:1* config.timeout = 10
irb(main):006:0> end
=> 10
irb(main):010:0> Vault.sys.seal_status
/usr/lib/ruby/gems/3.1.0/gems/json-3.0.0/lib/json/common.rb:296:in `parse': wrong number of arguments (given 2, expected 1) (ArgumentError)
...
```
When removing the JSON 3.0.2 and 3.0.0 versions it works again.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with `require "vault"` and `Vault.sys.seal_status` while JSON 3.0.0 or 3.0.2 is installed, then trace the call into the JSON parsing shown at `json/common.rb:296`. Compare the behavior with JSON 2.21.2 and make the client compatible with JSON 3.x; confirm the seal-status request works without an argument error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, ruby
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100