brianmario / yajl-ruby

A streaming JSON parsing and encoding library for Ruby (C bindings to yajl)
http://rdoc.info/projects/brianmario/yajl-ruby
MIT License
1.48k stars 169 forks source link

JSON gem compatibility doesn't object_class #227

Open technicalpickles opened 1 year ago

technicalpickles commented 1 year ago

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.