Open
Description
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