Skip to content

Add support for meta in dataset #47

Description

@ianks

Sometimes, APIs like to key their response JSON in a weird way. For example, one API we use returns results in two ways:

{
  "results": []
}
{
  "customers": []
}

In order to account for this, it would be nice to have a way to attach meta on the dataset, as you can with the relation. That way, we can know the correct key to unwrap the response in the response handler.

Right now, we are hacking around this by storing the key in the params, which is not ideal.

Examples

dataset do
  with_meta(result_key: :customers)
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions