6 ms·
If I were writing an API in Ruby today I would define my output types as Sorbet structs and call `serialize.to_json` on them at render time. I haven't benchmark
by zrail 6y ago
If I were writing an API in Ruby today I would define my output types as Sorbet structs and call `serialize.to_json` on them at render time. I haven't benchmarked it against anything but it seems reasonably fast.
- cooljacob204 6y agoWhile I have heard a lot of good things about Sorbet I would still hesitate to use it with Ruby 3 and it's type language RBS around the corner.