{"action":"created","issue":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/1285","labels_url":"https://api.github.com/repos/WP-API/WP-API/issues/1285/labels{/name}","comments_url":"https://api.github.com/repos/WP-API/WP-API/issues/1285/comments","events_url":"https://api.github.com/repos/WP-API/WP-API/issues/1285/events","html_url":"https://github.com/WP-API/WP-API/pull/1285","id":80173014,"number":1285,"title":"Experimental - Auto route registration","user":{"login":"joehoyle","id":161683,"avatar_url":"https://avatars.githubusercontent.com/u/161683?v=3","gravatar_id":"","url":"https://api.github.com/users/joehoyle","html_url":"https://github.com/joehoyle","followers_url":"https://api.github.com/users/joehoyle/followers","following_url":"https://api.github.com/users/joehoyle/following{/other_user}","gists_url":"https://api.github.com/users/joehoyle/gists{/gist_id}","starred_url":"https://api.github.com/users/joehoyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehoyle/subscriptions","organizations_url":"https://api.github.com/users/joehoyle/orgs","repos_url":"https://api.github.com/users/joehoyle/repos","events_url":"https://api.github.com/users/joehoyle/events{/privacy}","received_events_url":"https://api.github.com/users/joehoyle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/WP-API/WP-API/labels/Discussion","name":"Discussion","color":"eb6420"},{"url":"https://api.github.com/repos/WP-API/WP-API/labels/Infrastructure","name":"Infrastructure","color":"006b75"}],"state":"closed","locked":false,"assignee":{"login":"joehoyle","id":161683,"avatar_url":"https://avatars.githubusercontent.com/u/161683?v=3","gravatar_id":"","url":"https://api.github.com/users/joehoyle","html_url":"https://github.com/joehoyle","followers_url":"https://api.github.com/users/joehoyle/followers","following_url":"https://api.github.com/users/joehoyle/following{/other_user}","gists_url":"https://api.github.com/users/joehoyle/gists{/gist_id}","starred_url":"https://api.github.com/users/joehoyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehoyle/subscriptions","organizations_url":"https://api.github.com/users/joehoyle/orgs","repos_url":"https://api.github.com/users/joehoyle/repos","events_url":"https://api.github.com/users/joehoyle/events{/privacy}","received_events_url":"https://api.github.com/users/joehoyle/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-24T14:13:54Z","updated_at":"2015-12-07T23:39:04Z","closed_at":"2015-12-07T23:39:04Z","pull_request":{"url":"https://api.github.com/repos/WP-API/WP-API/pulls/1285","html_url":"https://github.com/WP-API/WP-API/pull/1285","diff_url":"https://github.com/WP-API/WP-API/pull/1285.diff","patch_url":"https://github.com/WP-API/WP-API/pull/1285.patch"},"body":"Given that we have established a pretty clear pattern for our controllers, as an experiment I wanted to see if we could auto register the routes based off what is implemented in each controller. It worked out pretty well, at least with the current abstraction.\n\nThe idea for this came when I was writing documentation for adding routes. By implementing `WP_REST_Controller` it's also required that one know the syntax and underlaying API of `register_rest_route` which would be nice to not _require_. Of course, child classes can always overwrite `register_routes` if required (which for example `WP_REST_Users_Controller` does."},"comment":{"url":"https://api.github.com/repos/WP-API/WP-API/issues/comments/162706141","html_url":"https://github.com/WP-API/WP-API/pull/1285#issuecomment-162706141","issue_url":"https://api.github.com/repos/WP-API/WP-API/issues/1285","id":162706141,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2015-12-07T23:39:04Z","updated_at":"2015-12-07T23:39:04Z","body":"Punt on this for now: https://wordpress.slack.com/archives/core-restapi/p1449531502001344\r\n\r\nWe could come back to it once we feel more comfortable about the abstraction."}}