Closed dorner closed 11 months ago
@dorner I think this is a reasonable request - and I agree generally with the approach.
Go for it on the PR - feel free to ping if you need assistance.
Thanks - here it is! #193 Let me know if I need to make any changes.
What? Why?
Currently,
gruf
only supports hashes when sending messages - it won't allow you to actually pass in the request object itself. E.g. in client_spec.rb, this doesn't work:We'd really like to use the request object directly because we can make use of Sorbet generated types when we do this. We also can't just call
to_h
on the object and pass it in, because there are bugs in this method (such as this one).Other Notables
It seems like this would be simple enough to implement by just checking to see if the passed in
params
respond to theto_proto
message and if so, not to call therequest_object
method and just use it as is.I can have a quick PR with this up if there are no objections.