Skip to content

Deprecation warnings from multi_json 1.21.0 #278

@trevorturk

Description

@trevorturk

Summary

With multi_json v1.21.0+, running tests or using dogapi produces deprecation warnings:

MultiJSON.dump is deprecated and will be removed in v2.0. Use MultiJSON.generate instead.
MultiJSON.load is deprecated and will be removed in v2.0. Use MultiJSON.parse instead.

Details

multi_json v1.21.0 renamed the public API to match Ruby stdlib JSON:

  • MultiJson.loadMultiJSON.parse
  • MultiJson.dumpMultiJSON.generate
  • MultiJson (camelCase) → MultiJSON (all caps)

The legacy methods still work but emit one-time deprecation warnings and will be removed in v2.0.

See: https://github.com/sferik/multi_json#readme

Affected code

  • lib/dogapi/common.rb:71 - MultiJson.load(resp.body)
  • lib/dogapi/common.rb:162 - MultiJson.dump(body)
  • lib/dogapi/common.rb:190 - MultiJson.load(resp.body)

Suggested fix

Update to use the new API:

MultiJSON.parse(...)  # instead of MultiJson.load(...)
MultiJSON.generate(...) # instead of MultiJson.dump(...)

Or pin multi_json to < 1.21 in the gemspec until ready to migrate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions