-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json 1.8.6 produces a deprecation on ruby 2.7 #399
Comments
This same problem occurs in version 2.2. What is strange is that it appears to be immune to setting RUBYOPT='-W:no-deprecated -W:no-experimental' - the deprecation messages print like crazy anyway (and I have seen it suppress the same messages from every other source that was producing them.) |
+1 It appears everywhere |
Please it's so chatty... |
I'm not sure what maintenance status about v1.8 by flori as primary owner. At least, I have no plan to maintain json-1.8.x in 2020. I suggest to upgrade json-2.3.0 |
Doing so is making it hard to upgrade to ruby 2.7. See ruby/json#399
Any solutions? |
Use json-2.x. |
There's a lot of gems that still require json ~> 1.8... would be very nice to have a 1.8.7 that fixes this particular warning. |
Using Rails, this seems to get rid of the warnings: # config/initializers/json.rb
module JSON
module_function
def parse(source, opts = {})
Parser.new(source, **opts).parse
end
end |
@airblade For me, your solution was no dice :( |
Because json-1.8.x gem produces a deprecation warning on Ruby 2.7. see: ruby/json#399
Because json-1.8.x gem produces a deprecation warning on Ruby 2.7. see: ruby/json#399
Because json-1.8.x gem produces a deprecation warning on Ruby 2.7. see: ruby/json#399
Because json-1.8.x gem produces a deprecation warning on Ruby 2.7. see: ruby/json#399
you're solutions really saved my day ! |
Using this patch ruby/json#399 (comment) We can upgrade to json v2 but to do that we need to switch from aws-sdk-v1 to aws-sdk-s3 first
Using this patch ruby/json#399 (comment) We can upgrade to json v2 but to do that we need to switch from aws-sdk-v1 to aws-sdk-s3 first
One commit that solves a few issues: - Support faraday 1.x - Update supported Ruby versions (only Ruby 2.5, 2.6, 2.7) - Update webmock(~> 3.0) to fix an incompatibility with faraday-1.x - Do not specify "json" gem's version, because json-1.8.x gem produces a deprecation warning on Ruby 2.7. [1] - Drop public_suffix from dependencies. [1]: ruby/json#399
Based on ruby#399 (comment) The `|| {}` bit makes sure that calls via `JSON(...)` continue to work: when no second argument is passed to the `JSON(...)` call then `JSON.parse` ends up being called with `opts=nil` which results in an exception (cannot convert nil into hash).
Based on ruby#399 (comment) The `|| {}` bit makes sure that calls via `JSON(...)` continue to work: when no second argument is passed to the `JSON(...)` call then `JSON.parse` ends up being called with `opts=nil` which results in an exception (cannot convert nil into hash).
* Fix kwargs handling for ruby 3 Based on ruby#399 (comment) The `|| {}` bit makes sure that calls via `JSON(...)` continue to work: when no second argument is passed to the `JSON(...)` call then `JSON.parse` ends up being called with `opts=nil` which results in an exception (cannot convert nil into hash). * Run CI for ruby 3 * Bump test-unit to version 3.X * Fix handling of create_additions flag when nil is passed as opts
https://github.com/flori/json/blob/7f4cfd853f2c919d854fb95548a19980feff17e8/lib/json/common.rb#L155
This line produces the following deprecation message:
It'd be nice to get a patch-level bump to silence this particular deprecation.
The text was updated successfully, but these errors were encountered: