You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
I've never been a fan of much of the work the Sawyer layer does in this SDK. I'm considering an option to completely bypass it - and perhaps replace some of the benefit we do get from it with simpler alternatives.
The funky Sawyer:: Resource results that often get in the way - and require one to call to_attrs (or map(&:to_attrs) if the result is an array!) in order to do any non-trivial work with a request result.
The thing is, while some of the deserialization stuff can really get in the way, some the other serialization stuff is important; e.g. converting times using Time.iso8601.
An alternative might be options that leave Sawyer in place, but give some specific control over its behavior; e.g. an option to not deserialize dates/times and a separate option to return results as hashes rather than as Sawyer:: Resource. Note that we previously added the 'raw_responses' option that skips all deserialization and returns raw json instead.
I've never been a fan of much of the work the Sawyer layer does in this SDK. I'm considering an option to completely bypass it - and perhaps replace some of the benefit we do get from it with simpler alternatives.
The main annoyances for me are:
The date/time deserialization based on field names https://github.com/lostisland/sawyer/blob/master/lib/sawyer/serializer.rb#L123-L125
This has been a terrible fit for Looker's API and has gotten in the way a few times.
The funky Sawyer:: Resource results that often get in the way - and require one to call
to_attrs
(ormap(&:to_attrs)
if the result is an array!) in order to do any non-trivial work with a request result.The thing is, while some of the deserialization stuff can really get in the way, some the other serialization stuff is important; e.g. converting times using Time.iso8601.
An alternative might be options that leave Sawyer in place, but give some specific control over its behavior; e.g. an option to not deserialize dates/times and a separate option to return results as hashes rather than as Sawyer:: Resource. Note that we previously added the 'raw_responses' option that skips all deserialization and returns raw json instead.
@dthorpe @conrizzle
The text was updated successfully, but these errors were encountered: