{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/issues/58","labels_url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/issues/58/comments","events_url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/issues/58/events","html_url":"https://github.com/alphagov/digitalmarketplace-api/pull/58","id":65204270,"number":58,"title":"Pc add supplier route","user":{"login":"pcraig3","id":2454380,"avatar_url":"https://avatars.githubusercontent.com/u/2454380?v=3","gravatar_id":"","url":"https://api.github.com/users/pcraig3","html_url":"https://github.com/pcraig3","followers_url":"https://api.github.com/users/pcraig3/followers","following_url":"https://api.github.com/users/pcraig3/following{/other_user}","gists_url":"https://api.github.com/users/pcraig3/gists{/gist_id}","starred_url":"https://api.github.com/users/pcraig3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcraig3/subscriptions","organizations_url":"https://api.github.com/users/pcraig3/orgs","repos_url":"https://api.github.com/users/pcraig3/repos","events_url":"https://api.github.com/users/pcraig3/events{/privacy}","received_events_url":"https://api.github.com/users/pcraig3/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-30T12:51:54Z","updated_at":"2015-04-07T14:11:13Z","closed_at":"2015-04-07T09:55:49Z","pull_request":{"url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/pulls/58","html_url":"https://github.com/alphagov/digitalmarketplace-api/pull/58","diff_url":"https://github.com/alphagov/digitalmarketplace-api/pull/58.diff","patch_url":"https://github.com/alphagov/digitalmarketplace-api/pull/58.patch"},"body":"Hey everyone, added in a `/supplier/{supplier_id}` endpoint to the API\r\n\r\nThis also meant:\r\n* Adding a few unit tests\r\n* Updating the explorer files to return suppliers\r\n* And, finally, renaming the `app/main/views.py` file to `app/main/views/services.py`, in order to avoid a cryptic error (thanks @allait!)"},"comment":{"url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/issues/comments/90575816","html_url":"https://github.com/alphagov/digitalmarketplace-api/pull/58#issuecomment-90575816","issue_url":"https://api.github.com/repos/alphagov/digitalmarketplace-api/issues/58","id":90575816,"user":{"login":"pcraig3","id":2454380,"avatar_url":"https://avatars.githubusercontent.com/u/2454380?v=3","gravatar_id":"","url":"https://api.github.com/users/pcraig3","html_url":"https://github.com/pcraig3","followers_url":"https://api.github.com/users/pcraig3/followers","following_url":"https://api.github.com/users/pcraig3/following{/other_user}","gists_url":"https://api.github.com/users/pcraig3/gists{/gist_id}","starred_url":"https://api.github.com/users/pcraig3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcraig3/subscriptions","organizations_url":"https://api.github.com/users/pcraig3/orgs","repos_url":"https://api.github.com/users/pcraig3/repos","events_url":"https://api.github.com/users/pcraig3/events{/privacy}","received_events_url":"https://api.github.com/users/pcraig3/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T14:11:13Z","updated_at":"2015-04-07T14:11:13Z","body":"#### Final Response looks like this \r\n\r\n![screen shot 2015-04-07 at 10 39 50](https://cloud.githubusercontent.com/assets/2454380/7024932/07b3821c-dd38-11e4-8016-f3b2424cd8ae.png)\r\n\r\n***\r\nAnd just for posterity's sake, here's how the various issues raised were addressed.\r\n\r\n##### 1. A `self` link to each supplier like we do for services\r\n\r\nYup, done.  :thumbsup:\r\n\r\n##### 2. A link to the suppliers list from the root like we do for `services.list`\r\n\r\n:-1: Didn't get included because we don't actually have a `suppliers.list` route at present.  The only way to get a list is to use the `/suppliers?prefix={whatever}` route, which never returns all suppliers.\r\n\r\n##### 3. If it's only for an A-Z (and 0-9) listing of suppliers then I'd say it should only allow a single character, and reject anything longer with a \"400 Bad Request\".\r\n\r\n:no_good: Didn't put any logic in about prefix strings because no definitive answers on what that logic should look like.\r\n\r\n##### 4. The response should probably be paginated\r\n\r\n:+1: Yup, good.  Response is paginated: returns 100 suppliers at a time.   (Incidentally, the variable deciding how many things are returned [is kind of bad](https://github.com/alphagov/digitalmarketplace-api/blob/master/app/main/views/services.py#L13).)\r\n\r\n"}}