Replace deprecated MultiJson constant with JSON.parse#151
Open
maximn wants to merge 1 commit into
Open
Conversation
The multi_json gem (1.21.x) deprecated the CamelCase MultiJson constant in favor of MultiJSON, and will remove it entirely in v2.0. Loading the generated client currently emits: The MultiJson constant is deprecated and will be removed in v2.0. Use MultiJSON instead. Switch to the stdlib JSON.parse instead, matching what heroics 0.1.4's generator template already emits (heroics 0.1.4 also dropped its multi_json dependency). Behavior is unchanged: both calls parse the same JSON schema literal at load time. This is a surgical edit to the generated file; a future 'rake build' against heroics >= 0.1.4 will produce the same line.
ElrubyTAM
approved these changes
May 17, 2026
Author
|
Thanks for the review! That block is a verbatim quote of the deprecation warning emitted by The PR's fix is different (and stronger) than what the warning suggests: rather than switching to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the deprecated
MultiJsonconstant withJSON.parsein the generated client.Why
The
multi_jsongem in its 1.21.x line deprecated the CamelCaseMultiJsonconstant in favor ofMultiJSON(all-caps), and will remove it entirely in v2.0. As a result, simply loadingplatform-apinow emits a deprecation warning on every Ruby process:This affects every downstream consumer of
platform-api— the warning is emitted whether or not you ever call the Heroku API in your process.Approach
The generator (
heroics) has already fixed this upstream:heroics 0.1.3template emitsMultiJson.load(...)heroics 0.1.4template emitsJSON.parse(...)and removed itsmulti_jsondependency entirely (CHANGELOG)The
platform-apigemspec already allowsheroics ~> 0.1.1, so the long-term fix is justbundle update heroics && rake build. However, that produces a noisy ~1,900-line whitespace-only diff (heroics 0.1.4 also tweaked template whitespace), which is hard to review.This PR applies the single substantive change —
MultiJson.load→JSON.parse— directly so the deprecation warning goes away immediately without the whitespace churn. The next time someone runsrake buildagainstheroics >= 0.1.4, the regenerated file will produce the same line.Compatibility
JSON.parseis part of the Ruby standard library — no new dependency.