yajl-ruby icon indicating copy to clipboard operation
yajl-ruby copied to clipboard

JSON gem compatibility doesn't object_class

Open technicalpickles opened this issue 2 years ago • 0 comments

I wanted to test this in our app, but I saw some sorbet errors:

TypeError:
  T.let: Expected type OpenStruct, got type Hash with value {"..."=>"..."}
  Caller: some_ruby.rb:71

The code in question:

    PRICE = T.let(
      JSON.parse("....", object_class: OpenStruct)
    )

This tells me that object_class isn't supported in yajl-ruby. I am pretty sure I can remove the usage of these because they are weird, but I figure I would still submit in case anyone else runs into it.

technicalpickles avatar Aug 11 '23 16:08 technicalpickles