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

Consider an option to bypass/replace Sawyer #57

Description

@jbandhauer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions