Skip to content

fix: lock json dependency to < 3 - #29

Closed
knarewski wants to merge 1 commit into
red-data-tools:masterfrom
knarewski:lock-json-version-below-3
Closed

knarewski wants to merge 1 commit into
red-data-tools:masterfrom
knarewski:lock-json-version-below-3

Conversation

@knarewski

Copy link
Copy Markdown
Contributor

json v3 drops create_additions keyword from JSON.load, making it crash with NameError in Colors::ColormapRegistry.load_colormap_data .

Locking to a working version is the safest/most obvious first step

JSON 3 drops create_additions keyword from JSON.load, making it crash with NameError
in Colors::ColormapRegistry.load_colormap_data .
Locking to working version is the safest first step
kou pushed a commit that referenced this pull request Sep 8, 2026
### Problem 
[json v3](https://github.com/ruby/json/releases/tag/v3.0.0) removes
`create_additions` option from `JSON.load`, raising `NameError` in
[Colors::ColormapRegistry.load_colormap_data](https://github.com/red-data-tools/red-colors/blob/36492692b3d78f64b1cc5e20f77058b35803ebc4/lib/colors/colormap_data.rb#L15)

### Solution
`JSON.load` seems like `JSON.parse` with some extra no-op steps, making
`JSON.parse` more appropriate here

### Notes
The safest fix is [locking json
version](#29). This PR
is a direct fix, slightly more invasive but still relatively safe.

### References
- [source of JSON.load
(v2.21.2)](https://github.com/ruby/json/blob/5a32e4367ca5976f62af12887a09685b7109b054/lib/json/common.rb#L865-L902)
@kou

kou commented Sep 8, 2026

Copy link
Copy Markdown
Member

I close this in favor of #30.

@kou kou closed this Sep 8, 2026
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.

2 participants