Skip to content

fix(core): bump dependencies representable to ~> 3.3 and multi_json to ~> 1.21 (#26611) - #28003

Open
larouxn wants to merge 2 commits into
googleapis:mainfrom
larouxn:bump_representable
Open

larouxn wants to merge 2 commits into
googleapis:mainfrom
larouxn:bump_representable

Conversation

@larouxn

@larouxn larouxn commented Sep 24, 2026 •

Copy link
Copy Markdown

To ensure we don't encounter representable gem based MultiJson deprecation warnings I am proposing we raise the representable gem version requirement from ~> 3.0 to ~> 3.3 and multi_json gem version requirement from ~> 1.11 to ~> 1.21.

Relevant links

@larouxn
larouxn requested a review from a team as a code owner September 24, 2026 10:40
@@ -26,6 +26,6 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'googleauth', '~> 1.14'
gem.add_runtime_dependency 'mini_mime', '~> 1.1'
gem.add_runtime_dependency 'multi_json', '~> 1.11'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump multi_json to '~> 1.21'

@larouxn larouxn changed the title fix(core): bump representable dependency to ~> 3.3 (#26611) fix(core): bump dependencies representable to ~> 3.3 and multi_json to ~> 1.21 (#26611) Sep 25, 2026
@larouxn
larouxn requested a review from seuros September 25, 2026 13:49

@torreypayne torreypayne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larouxn LGTM to bump the dependencies for maintenance, but are you sure this update actually clears the warnings? Can you repro?

@quartzmo
quartzmo requested review from quartzmo and removed request for seuros September 25, 2026 21:51
@larouxn

larouxn commented Sep 26, 2026 •

Copy link
Copy Markdown
Author

@larouxn LGTM to bump the dependencies for maintenance, but are you sure this update actually clears the warnings? Can you repro?

Thanks for the review! Good call. Unfortunately I believe that due to this (temporary I hope) compatibility fix some deprecation warnings will still appear. I suppose until representable drops that we will continue to see some deprecation warnings, despite representable v3.3.0 specifically noting it will: "Fix deprecations with MultiJson.".

https://github.com/trailblazer/representable/blob/a0612bf545f742fe3f3be9d554cbae18bea10b75/lib/representable/json.rb#L9-L18

Reproduction Test (disclaimer: LLM assisted)

Running this script with representable 3.2.0 vs 3.3.0 demonstrates the behaviour:

# test_repro.rb
require "multi_json"       # 1.21.1
require "representable/json"

class Model
  attr_accessor :name
  def initialize(name = nil); @name = name; end
end

module ModelRepresenter
  include Representable::JSON
  property :name
end

m = Model.new("Alice")
m.extend(ModelRepresenter).to_json
Model.new.extend(ModelRepresenter).from_json('{"name":"Bob"}')

Result with representable 3.2.0 (ruby -W:deprecated test_repro.rb):

The MultiJson constant is deprecated and will be removed in v2.0. Use MultiJSON instead.
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.

Result with representable 3.3.0 (ruby -W:deprecated test_repro.rb):

The MultiJson constant is deprecated and will be removed in v2.0. Use MultiJSON instead.
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.

Note: If we remove Representable::JSON::MultiJSON from representable so it actually delegates to top-level ::MultiJSON, all warnings should disappear completely.

@larouxn
larouxn force-pushed the bump_representable branch from 8bd2ca8 to c2730d8 Compare October 2, 2026 09:56
@larouxn

larouxn commented Oct 2, 2026

Copy link
Copy Markdown
Author

Rebased on latest main to pick up potential fixes from #28043.

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.

3 participants