lostisland / sawyer

Secret User Agent of HTTP
MIT License
247 stars 75 forks source link

Sawyer::Resource.as_json returns nested Arrays #39

Closed artursapek closed 9 years ago

artursapek commented 9 years ago

I don't grok why this library exists or why octokit felt the need to use it, but it gets a very fundamental thing wrong. Sawyer::Resource.as_json returns nested Arrays rather than a nested Hash. This makes it really hard to work with out of the box.

image

pengwynn commented 9 years ago

Sawyer doesn't know anything about .as_json since that's an ActiveModel method. I suspect Sawyer::Resource#to_hash will get you closer to your desired results.