Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix letter class to check if object is a string before matching #216

Closed
wants to merge 1 commit into from

Conversation

arich
Copy link

@arich arich commented Aug 10, 2023

Hi there,
I'm trying to update a Ruby on Rails app to Ruby 3.2 and we hit an error with one of our specs using the lob-ruby sdk.

The error was:

     NoMethodError:
       undefined method `=~' for [:ReturnEnvelope, :Boolean]:Array
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/models/letter.rb:624:in `block in build_from_hash'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/models/letter.rb:621:in `each_pair'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/models/letter.rb:621:in `build_from_hash'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/models/letter.rb:612:in `build_from_hash'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/api_client.rb:282:in `convert_to_type'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/api_client.rb:242:in `deserialize'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/api_client.rb:73:in `call_api'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/api/letters_api.rb:158:in `letter_create_with_http_info'
     # /usr/local/bundle/gems/lob-6.0.2/lib/openapi_client/api/letters_api.rb:97:in `create'

In Ruby 3.2, they removed a deprecated method =~ on Object.
https://rubyreferences.github.io/rubychanges/3.2.html#removals

This seemed to fix it locally. I'm not sure what your standards are for this gem so this is the minimum change. Let me know what else you need for this to be merged. Thank you!

@arich
Copy link
Author

arich commented Aug 10, 2023

FYI specs passed locally using Ruby 3.2.

$ rspec -P __tests__/Api/* --color --format doc
...
Finished in 0.15242 seconds (files took 0.3072 seconds to load)
199 examples, 0 failures

@lobster-hunter-y
Copy link

Hi @arich ,

Thank you very much for flagging this!

Currently, Lob's SDKs are generated via OpenAPI, so we are unable to accept and merge your pull request directly. However, our engineering team has been notified of this issue, and have confirmed that they will review the request and attempt to incorporate the changes into the generator for the next version.

I hope this helps! Please feel encouraged to let us know if you have any further questions :)

@arich
Copy link
Author

arich commented Sep 14, 2023

Thanks @lobster-hunter-y! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants