Update generated code for private-preview#1822
Open
stripe-openapi[bot] wants to merge 8 commits intoprivate-previewfrom
Open
Update generated code for private-preview#1822stripe-openapi[bot] wants to merge 8 commits intoprivate-previewfrom
stripe-openapi[bot] wants to merge 8 commits intoprivate-previewfrom
Conversation
stripe does not have a dependency on cgi. If you have stripe in your Gemfile, but not cgi, there is a verbose mode warning when requiring stripe on Ruby 4.0. Example file: ``` require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'stripe' gem 'logger' # Missing gem dependency on logger, different issue end require "stripe" ``` Running in verbose mode: ``` $ ruby -v t.rb ruby 4.0.2 (2026-03-17 revision d3da9fec82) +PRISM [x86_64-linux] /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:5: warning: CGI library is removed from Ruby 4.0. Please use cgi/escape instead for CGI.escape and CGI.unescape features. If you need to use the full features of CGI library, Please install cgi gem. ``` The only cases in that are using a CGI method other than CGI.escape is in a couple tests using CGI.parse, so add cgi to the Gemfile and require cgi in those two test files. Switch the cgi require in lib to cgi/escape. This avoids the warning, and will avoid breakage in Ruby 4.1.
8706e12 to
7c89eea
Compare
* Update generated code for v2202 and * Update generated code for v2202 and * Update generated code for v2203 and * Update generated code for v2204 and * Update generated code for v2204 and * Update generated code for v2204 and --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>
stripe is missing a gem dependency on logger. When including stripe in a Gemfile, if logger is not specified directly or included transitively by another gem, this warns in verbose mode on Ruby 3.4, and results in an error on Ruby 4.0. Example file: ``` require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'stripe' end require "stripe" ``` Running on Ruby 4.0.2: ``` $ ruby -v; ruby t.rb ruby 4.0.2 (2026-03-17 revision d3da9fec82) +PRISM [x86_64-linux] /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:7: warning: logger used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0. You can add logger to your Gemfile or gemspec to fix this error. /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:71:in 'block (2 levels) in Bundler::Runtime#require': There was an error while trying to load the gem 'stripe'. (Bundler::GemRequireError) Gem Load Error is: cannot load such file -- logger Backtrace for gem load error is: /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:7:in '<top (required)>' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel.replace_require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:63:in 'block (2 levels) in Bundler::Runtime#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'Array#each' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Array#each' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Bundler::Runtime#require' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:91:in 'block in Object#gemfile' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/settings.rb:143:in 'Bundler::Settings#temporary' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:60:in 'Object#gemfile' t.rb:3:in '<main>' Bundler Error Backtrace: from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:91:in 'block in Object#gemfile' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/settings.rb:143:in 'Bundler::Settings#temporary' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:60:in 'Object#gemfile' from t.rb:3:in '<main>' /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- logger (LoadError) from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/gems/4.0.0/gems/stripe-18.4.2/lib/stripe.rb:7:in '<top (required)>' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel.replace_require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:63:in 'block (2 levels) in Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Array#each' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/runtime.rb:52:in 'Bundler::Runtime#require' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:91:in 'block in Object#gemfile' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/settings.rb:143:in 'Bundler::Settings#temporary' from /home/jeremy/.local/share/mise/installs/ruby/4.0.2/lib/ruby/4.0.0/bundler/inline.rb:60:in 'Object#gemfile' from t.rb:3:in '<main>' ``` This is simple to fix by including logger as a gem dependency. Co-authored-by: David Brownman <109395161+xavdid-stripe@users.noreply.github.com>
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.
Codegen for openapi v2205 and proto spec .
Changelog