Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Consider an option to bypass/replace Sawyer #57

Open
jbandhauer opened this issue May 24, 2017 · 0 comments
Open

Consider an option to bypass/replace Sawyer #57

jbandhauer opened this issue May 24, 2017 · 0 comments

Comments

@jbandhauer
Copy link
Contributor

jbandhauer commented May 24, 2017

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:

  1. 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.

  2. 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.

@dthorpe @conrizzle

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant