{"action":"created","issue":{"url":"https://api.github.com/repos/solidusio/solidus/issues/319","labels_url":"https://api.github.com/repos/solidusio/solidus/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/319/comments","events_url":"https://api.github.com/repos/solidusio/solidus/issues/319/events","html_url":"https://github.com/solidusio/solidus/pull/319","id":102903351,"number":319,"title":"Add an Api Resource Controller","user":{"login":"athal7","id":467872,"avatar_url":"https://avatars.githubusercontent.com/u/467872?v=3","gravatar_id":"","url":"https://api.github.com/users/athal7","html_url":"https://github.com/athal7","followers_url":"https://api.github.com/users/athal7/followers","following_url":"https://api.github.com/users/athal7/following{/other_user}","gists_url":"https://api.github.com/users/athal7/gists{/gist_id}","starred_url":"https://api.github.com/users/athal7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athal7/subscriptions","organizations_url":"https://api.github.com/users/athal7/orgs","repos_url":"https://api.github.com/users/athal7/repos","events_url":"https://api.github.com/users/athal7/events{/privacy}","received_events_url":"https://api.github.com/users/athal7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-24T22:15:52Z","updated_at":"2015-08-25T08:53:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/319","html_url":"https://github.com/solidusio/solidus/pull/319","diff_url":"https://github.com/solidusio/solidus/pull/319.diff","patch_url":"https://github.com/solidusio/solidus/pull/319.patch"},"body":"To abstract away a lot of the similarities among the api controllers.\r\nThis should make it easier to make changes to how we do templating,\r\nauthorization, or param whitelisting in the future.\r\n\r\n===========================================================\r\n\r\nEven though the api/users_controller no longer has logic, I left the specs\r\nin place for this PR to demonstrate API compatibility. Happy to remove them if we\r\nsee them as being superfluous.\r\n\r\nI also chose to not reuse too many pieces of the admin/resource_controller because\r\nthere is a lot of hard-to-follow code in there, so hopefully this new one can be a\r\ngood clean space to refactor and then share code back to the admin/resource_controller.\r\n\r\nMore controllers to inherit from this later barring successful acceptance into the codebase."},"comment":{"url":"https://api.github.com/repos/solidusio/solidus/issues/comments/134530351","html_url":"https://github.com/solidusio/solidus/pull/319#issuecomment-134530351","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/319","id":134530351,"user":{"login":"BenMorganIO","id":3117356,"avatar_url":"https://avatars.githubusercontent.com/u/3117356?v=3","gravatar_id":"","url":"https://api.github.com/users/BenMorganIO","html_url":"https://github.com/BenMorganIO","followers_url":"https://api.github.com/users/BenMorganIO/followers","following_url":"https://api.github.com/users/BenMorganIO/following{/other_user}","gists_url":"https://api.github.com/users/BenMorganIO/gists{/gist_id}","starred_url":"https://api.github.com/users/BenMorganIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenMorganIO/subscriptions","organizations_url":"https://api.github.com/users/BenMorganIO/orgs","repos_url":"https://api.github.com/users/BenMorganIO/repos","events_url":"https://api.github.com/users/BenMorganIO/events{/privacy}","received_events_url":"https://api.github.com/users/BenMorganIO/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T08:53:05Z","updated_at":"2015-08-25T08:53:05Z","body":"One thing I'd love to start work on with Solidus is a second version of the API. I think we should move all API requests to a v1 namespace and maybe start building out a second API and deprecate this existing one and move it to its own gem.\r\n\r\nI have experimented with a `Spree::Api::V2::ResourcesController` and it did feel like a pretty good controller to have around. Debugging can be kinda weird though.\r\n\r\nI would personally try and put effort into building a V2, rather than refactoring the V1, but I'm still :+1: for this PR."}}