{"action":"created","issue":{"url":"https://api.github.com/repos/ckan/ckan/issues/3239","repository_url":"https://api.github.com/repos/ckan/ckan","labels_url":"https://api.github.com/repos/ckan/ckan/issues/3239/labels{/name}","comments_url":"https://api.github.com/repos/ckan/ckan/issues/3239/comments","events_url":"https://api.github.com/repos/ckan/ckan/issues/3239/events","html_url":"https://github.com/ckan/ckan/pull/3239","id":176371787,"number":3239,"title":"[#3229] API Blueprint","user":{"login":"amercader","id":200230,"avatar_url":"https://avatars.githubusercontent.com/u/200230?v=3","gravatar_id":"","url":"https://api.github.com/users/amercader","html_url":"https://github.com/amercader","followers_url":"https://api.github.com/users/amercader/followers","following_url":"https://api.github.com/users/amercader/following{/other_user}","gists_url":"https://api.github.com/users/amercader/gists{/gist_id}","starred_url":"https://api.github.com/users/amercader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amercader/subscriptions","organizations_url":"https://api.github.com/users/amercader/orgs","repos_url":"https://api.github.com/users/amercader/repos","events_url":"https://api.github.com/users/amercader/events{/privacy}","received_events_url":"https://api.github.com/users/amercader/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ckan/ckan/labels/Pylons%20-%20Flask%20migration","name":"Pylons - Flask migration","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"TkTech","id":72590,"avatar_url":"https://avatars.githubusercontent.com/u/72590?v=3","gravatar_id":"","url":"https://api.github.com/users/TkTech","html_url":"https://github.com/TkTech","followers_url":"https://api.github.com/users/TkTech/followers","following_url":"https://api.github.com/users/TkTech/following{/other_user}","gists_url":"https://api.github.com/users/TkTech/gists{/gist_id}","starred_url":"https://api.github.com/users/TkTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TkTech/subscriptions","organizations_url":"https://api.github.com/users/TkTech/orgs","repos_url":"https://api.github.com/users/TkTech/repos","events_url":"https://api.github.com/users/TkTech/events{/privacy}","received_events_url":"https://api.github.com/users/TkTech/received_events","type":"User","site_admin":false},"assignees":[{"login":"TkTech","id":72590,"avatar_url":"https://avatars.githubusercontent.com/u/72590?v=3","gravatar_id":"","url":"https://api.github.com/users/TkTech","html_url":"https://github.com/TkTech","followers_url":"https://api.github.com/users/TkTech/followers","following_url":"https://api.github.com/users/TkTech/following{/other_user}","gists_url":"https://api.github.com/users/TkTech/gists{/gist_id}","starred_url":"https://api.github.com/users/TkTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TkTech/subscriptions","organizations_url":"https://api.github.com/users/TkTech/orgs","repos_url":"https://api.github.com/users/TkTech/repos","events_url":"https://api.github.com/users/TkTech/events{/privacy}","received_events_url":"https://api.github.com/users/TkTech/received_events","type":"User","site_admin":false},{"login":"wardi","id":153258,"avatar_url":"https://avatars.githubusercontent.com/u/153258?v=3","gravatar_id":"","url":"https://api.github.com/users/wardi","html_url":"https://github.com/wardi","followers_url":"https://api.github.com/users/wardi/followers","following_url":"https://api.github.com/users/wardi/following{/other_user}","gists_url":"https://api.github.com/users/wardi/gists{/gist_id}","starred_url":"https://api.github.com/users/wardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wardi/subscriptions","organizations_url":"https://api.github.com/users/wardi/orgs","repos_url":"https://api.github.com/users/wardi/repos","events_url":"https://api.github.com/users/wardi/events{/privacy}","received_events_url":"https://api.github.com/users/wardi/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-09-12T13:12:25Z","updated_at":"2016-10-27T14:39:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ckan/ckan/pulls/3239","html_url":"https://github.com/ckan/ckan/pull/3239","diff_url":"https://github.com/ckan/ckan/pull/3239.diff","patch_url":"https://github.com/ckan/ckan/pull/3239.patch"},"body":"Based off #3228\r\n\r\nThis is a genuine, organic, GM and Pylons free, 100% certified Flask-only API for CKAN. :cow: :tangerine: :white_check_mark: \r\n\r\nIt adds a new blueprint with the relevant API view functions (`ckan/views/api.py`). There is nothing clever about its structure:\r\n\r\n* Blueprint definition\r\n* Private methods\r\n* View functions\r\n* URL rules\r\n\r\nI'd love feedback about this as it will be replicated on all upcoming blueprints/controllers. I personally quite like having all routes definitions together at the end of the file rather than on decorators (specially if like in the REST ones you need to tweak them quite a lot).\r\n\r\nThere are a couple of minor endpoints that call the template rendering functions so the rendering logic on `ckan.lib.base` had to be modified so it worked on Flask. This needs to be addressed properly when\r\nwe migrate the first frontend controller, specially the logic around caching, but for now it works fine for the low-level template rendering done via the API.\r\n\r\nWhile I was at it I also did some cleaning and removed a lot of endpoints. Here's what's kept and what's left (again please provide any feedback you might have):\r\n\r\n#### Kept (migrated to Flask):\r\n\r\n* Action API (`/api/action`) - Obvs\r\n* REST API (`/api/rest`) - REST wrapper around actions. Deprecated, but some third party apps still use it\r\n* Autocomplete endpoints - (`/api/util/{x}/autocomplete`) - Used in the frontend\r\n* Snippet endpoint - (`/api/util/snippet`) - Used in the frontend tests\r\n\r\n#### Deprecated (kept active in the Pylons controller, to be removed in the next CKAN version\r\n\r\n* Search API (`/api/search/`) - Old, extensions can't hook into it\r\n* \"Munge\" endpoints\r\n\r\n\r\n#### Removed in this PR:\r\n\r\n* `/tag_counts` - Unused and easy to obtain with package_search\r\n* `/qos/throughput/` - Broken, returns exception\r\n* `/util/is_slug_valid` - Does not respect validation\r\n* `/util/resource/format_icon` - Unused, output broken\r\n* `/util/markdown` - Unused\r\n* `/util/status` - Unused, use `status_show` action\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ckan/ckan/issues/comments/256660481","html_url":"https://github.com/ckan/ckan/pull/3239#issuecomment-256660481","issue_url":"https://api.github.com/repos/ckan/ckan/issues/3239","id":256660481,"user":{"login":"deinok","id":6586053,"avatar_url":"https://avatars.githubusercontent.com/u/6586053?v=3","gravatar_id":"","url":"https://api.github.com/users/deinok","html_url":"https://github.com/deinok","followers_url":"https://api.github.com/users/deinok/followers","following_url":"https://api.github.com/users/deinok/following{/other_user}","gists_url":"https://api.github.com/users/deinok/gists{/gist_id}","starred_url":"https://api.github.com/users/deinok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deinok/subscriptions","organizations_url":"https://api.github.com/users/deinok/orgs","repos_url":"https://api.github.com/users/deinok/repos","events_url":"https://api.github.com/users/deinok/events{/privacy}","received_events_url":"https://api.github.com/users/deinok/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T14:39:02Z","updated_at":"2016-10-27T14:39:02Z","body":"What is the state of this?"}}
{"actor":{"display_login":"deinok"}}