From 4fc310aeab347032e8e8f20bc29fbce3881c601e Mon Sep 17 00:00:00 2001 From: Najib Najib Date: Sun, 20 Sep 2026 19:26:00 -0400 Subject: [PATCH 1/2] Remove unused oj dependency --- Gemfile.lock | 5 - lib/shopify_api.rb | 1 - shopify_api.gemspec | 1 - sorbet/rbi/gems/oj@3.13.11.rbi | 274 --------------------------------- sorbet/tapioca/require.rb | 1 - 5 files changed, 282 deletions(-) delete mode 100644 sorbet/rbi/gems/oj@3.13.11.rbi diff --git a/Gemfile.lock b/Gemfile.lock index 101e9cb2b..65d92ec29 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,6 @@ PATH httparty jwt logger - oj openssl securerandom sorbet-runtime @@ -68,11 +67,7 @@ GEM multi_xml (0.6.0) mutex_m (0.3.0) netrc (0.11.0) - oj (3.16.7) - bigdecimal (>= 3.0) - ostruct (>= 0.2) openssl (3.2.0) - ostruct (0.6.1) parallel (1.24.0) parser (3.3.0.5) ast (~> 2.4.1) diff --git a/lib/shopify_api.rb b/lib/shopify_api.rb index ba984b2a9..41b1e445a 100644 --- a/lib/shopify_api.rb +++ b/lib/shopify_api.rb @@ -3,7 +3,6 @@ $LOAD_PATH.unshift(File.dirname(__FILE__)) -require "oj" require "sorbet-runtime" require "securerandom" require "cgi" diff --git a/shopify_api.gemspec b/shopify_api.gemspec index babb52bc6..a634c8310 100644 --- a/shopify_api.gemspec +++ b/shopify_api.gemspec @@ -39,7 +39,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency("httparty") s.add_runtime_dependency("jwt") s.add_runtime_dependency("logger") - s.add_runtime_dependency("oj") s.add_runtime_dependency("openssl") s.add_runtime_dependency("securerandom") s.add_runtime_dependency("sorbet-runtime") diff --git a/sorbet/rbi/gems/oj@3.13.11.rbi b/sorbet/rbi/gems/oj@3.13.11.rbi deleted file mode 100644 index 240861d42..000000000 --- a/sorbet/rbi/gems/oj@3.13.11.rbi +++ /dev/null @@ -1,274 +0,0 @@ -# typed: true - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `oj` gem. -# Please instead update this file by running `bin/tapioca gem oj`. - -JSON::Parser = JSON::Ext::Parser -JSON::State = JSON::Ext::Generator::State - -module Oj - private - - def add_to_json(*_arg0); end - def compat_load(*_arg0); end - def default_options; end - def default_options=(_arg0); end - def dump(*_arg0); end - def fast_generate(*_arg0); end - def generate(*_arg0); end - def load(*_arg0); end - def load_file(*_arg0); end - def mimic_JSON(*_arg0); end - def object_load(*_arg0); end - def optimize_rails; end - def register_odd(*_arg0); end - def register_odd_raw(*_arg0); end - def remove_to_json(*_arg0); end - def safe_load(_arg0); end - def saj_parse(*_arg0); end - def sc_parse(*_arg0); end - def strict_load(*_arg0); end - def to_file(*_arg0); end - def to_json(*_arg0); end - def to_stream(*_arg0); end - def wab_load(*_arg0); end - - class << self - def add_to_json(*_arg0); end - def compat_load(*_arg0); end - def default_options; end - def default_options=(_arg0); end - def dump(*_arg0); end - def fast_generate(*_arg0); end - def generate(*_arg0); end - def load(*_arg0); end - def load_file(*_arg0); end - def mimic_JSON(*_arg0); end - def mimic_loaded(mimic_paths = T.unsafe(nil)); end - def object_load(*_arg0); end - def optimize_rails; end - def register_odd(*_arg0); end - def register_odd_raw(*_arg0); end - def remove_to_json(*_arg0); end - def safe_load(_arg0); end - def saj_parse(*_arg0); end - def sc_parse(*_arg0); end - def strict_load(*_arg0); end - def to_file(*_arg0); end - def to_json(*_arg0); end - def to_stream(*_arg0); end - def wab_load(*_arg0); end - end -end - -class Oj::Bag - def initialize(args = T.unsafe(nil)); end - - def ==(other); end - def eql?(other); end - def method_missing(m, *args, &block); end - def respond_to?(m); end - - class << self - def define_class(classname); end - end -end - -class Oj::CStack; end -Oj::CUSTOM_MIMIC_JSON_OPTIONS = T.let(T.unsafe(nil), Hash) -class Oj::Cache; end -class Oj::DepthError < ::Oj::Error; end - -class Oj::Doc - def clone; end - def close; end - def dump(*_arg0); end - def dup; end - def each_child(*_arg0); end - def each_leaf(*_arg0); end - def each_value(*_arg0); end - def exists?(_arg0); end - def fetch(*_arg0); end - def home; end - def local_key; end - def move(_arg0); end - def path; end - def size; end - def type(*_arg0); end - def where; end - def where?; end - - class << self - def open(_arg0); end - def open_file(_arg0); end - def parse(_arg0); end - end -end - -class Oj::EasyHash < ::Hash - def initialize; end - - def [](key); end - def method_missing(m, *args, &block); end - def respond_to?(m, include_all = T.unsafe(nil)); end -end - -class Oj::Error < ::StandardError; end -class Oj::LoadError < ::Oj::Error; end - -class Oj::MimicDumpOption < ::Hash - def initialize; end - - def []=(key, value); end -end - -class Oj::MimicError < ::Oj::Error; end -class Oj::ParseError < ::Oj::Error; end - -class Oj::Parser - def file(_arg0); end - def just_one; end - def just_one=(_arg0); end - def load(_arg0); end - def method_missing(*_arg0); end - def parse(_arg0); end - - private - - def new(*_arg0); end - def saj; end - def usual; end - def validate; end - - class << self - def new(*_arg0); end - def saj; end - def usual; end - def validate; end - end -end - -module Oj::Rails - private - - def deoptimize(*_arg0); end - def encode(*_arg0); end - def mimic_JSON; end - def optimize(*_arg0); end - def optimized?(_arg0); end - def set_decoder; end - def set_encoder; end - - class << self - def deoptimize(*_arg0); end - def encode(*_arg0); end - def mimic_JSON; end - def optimize(*_arg0); end - def optimized?(_arg0); end - def set_decoder; end - def set_encoder; end - end -end - -class Oj::Rails::Encoder - def deoptimize(*_arg0); end - def encode(_arg0); end - def optimize(*_arg0); end - def optimized?(_arg0); end - - private - - def new(*_arg0); end - - class << self - def new(*_arg0); end - end -end - -class Oj::Saj - def initialize; end - - private - - def add_value(value, key); end - def array_end(key); end - def array_start(key); end - def error(message, line, column); end - def hash_end(key); end - def hash_start(key); end -end - -class Oj::ScHandler - def initialize; end - - private - - def add_value(value); end - def array_append(a, value); end - def array_end; end - def array_start; end - def hash_end; end - def hash_key(key); end - def hash_set(h, key, value); end - def hash_start; end -end - -class Oj::StreamWriter - def flush; end - def pop; end - def pop_all; end - def push_array(*_arg0); end - def push_json(*_arg0); end - def push_key(_arg0); end - def push_object(*_arg0); end - def push_value(*_arg0); end - - private - - def new(*_arg0); end - - class << self - def new(*_arg0); end - end -end - -class Oj::StringWriter - def as_json; end - def pop; end - def pop_all; end - def push_array(*_arg0); end - def push_json(*_arg0); end - def push_key(_arg0); end - def push_object(*_arg0); end - def push_value(*_arg0); end - def raw_json; end - def reset; end - def to_s; end - - private - - def new(*_arg0); end - - class << self - def new(*_arg0); end - end -end - -Oj::VERSION = T.let(T.unsafe(nil), String) - -class String - include ::Comparable - include ::JSON::Ext::Generator::GeneratorMethods::String - extend ::JSON::Ext::Generator::GeneratorMethods::String::Extend - - def to_json_raw(*_arg0); end - def to_json_raw_object; end - - class << self - def json_create(obj); end - end -end - -String::BLANK_RE = T.let(T.unsafe(nil), Regexp) -String::ENCODED_BLANKS = T.let(T.unsafe(nil), Concurrent::Map) diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb index ee59758cd..1424e133b 100644 --- a/sorbet/tapioca/require.rb +++ b/sorbet/tapioca/require.rb @@ -12,7 +12,6 @@ require "minitest/autorun" require "mocha" require "mocha/minitest" -require "oj" require "securerandom" require "sorbet-runtime" require "uri" From 3c37c6c0e2faac450d6e49cd171074d9c84e5595 Mon Sep 17 00:00:00 2001 From: Najib Najib Date: Sun, 20 Sep 2026 19:36:23 -0400 Subject: [PATCH 2/2] Add changelog entry for removing oj --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56f20cf2f..726d6c8a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api ## Unreleased +- [#1462](https://github.com/Shopify/shopify-api-ruby/pull/1462) Remove unused `oj` dependency to restore JRuby support. ## 16.3.0 (2026-08-04) - [#1443](https://github.com/Shopify/shopify-api-ruby/pull/1443) Add `ShopifyAPI::Utils::ShopValidator` with `sanitize_shop_domain` and `sanitize!`.