{"action":"created","comment":{"url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/comments/30268362","id":30268362,"diff_hunk":"@@ -0,0 +1,203 @@\n+---\n+title: Hyperdrive\n+excerpt: A generic API Blueprint client in Swift\n+layout: post\n+date: 2015-05-07 16:00:00 +0100\n+author: kyle\n+published: true\n+comments: true\n+---\n+\n+It's extremely common to build API clients which are tightly coupled to\n+implementation detail. If you look at most API clients you will\n+often find hard-coded details about how an API works such as the HTTP\n+methods to use, URIs and information about content types. We design our\n+clients and APIs around out-of-band specifications which overly couple\n+our clients to our server.\n+\n+## Why is this a problem?\n+\n+This type of client design is rarely seen as a problem, it usually isn't\n+a problem immediately and only becomes a problem when you want to\n+change how the API works. Since clients are normally tightly coupled\n+to implementation details of an API. This often means you have to be\n+extremely careful when it comes to changing your API. You will often decide\n+against making certain changes because it will often break a client and\n+you'd rather stick to how it works. This problem is easily avoided if we\n+don't duplicate how our implementation works many times in each client.\n+\n+We often design our APIs by exposing implementation details, we use IDs\n+in our URIs and expect our clients to know how to construct these URIs\n+by knowing about our internal database ID.\n+\n+## API Evolvability\n+\n+You can't have evolvability if clients have their controls hard-coded into\n+their design at deployment. Controls have to be learned on the fly to\n+allow both the server and the client change independently over time.\n+\n+Imagine entering an API without knowing about any implementation details,\n+but instead just understanding of the semantics behind the API. We can load","path":"_posts/2015-05-07-Hyperdrive.md","position":40,"original_position":40,"commit_id":"b3afcb98487de17dfd8ba672720c7859cdb5086c","original_commit_id":"b3afcb98487de17dfd8ba672720c7859cdb5086c","user":{"login":"zdne","id":613617,"avatar_url":"https://avatars.githubusercontent.com/u/613617?v=3","gravatar_id":"","url":"https://api.github.com/users/zdne","html_url":"https://github.com/zdne","followers_url":"https://api.github.com/users/zdne/followers","following_url":"https://api.github.com/users/zdne/following{/other_user}","gists_url":"https://api.github.com/users/zdne/gists{/gist_id}","starred_url":"https://api.github.com/users/zdne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdne/subscriptions","organizations_url":"https://api.github.com/users/zdne/orgs","repos_url":"https://api.github.com/users/zdne/repos","events_url":"https://api.github.com/users/zdne/events{/privacy}","received_events_url":"https://api.github.com/users/zdne/received_events","type":"User","site_admin":false},"body":"We can **get the implementation details at runtime from the API** to allow us ... ","created_at":"2015-05-13T19:47:33Z","updated_at":"2015-05-13T19:47:33Z","html_url":"https://github.com/apiaryio/blog.apiary.io/pull/52#discussion_r30268362","pull_request_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/comments/30268362"},"html":{"href":"https://github.com/apiaryio/blog.apiary.io/pull/52#discussion_r30268362"},"pull_request":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52","id":34808492,"html_url":"https://github.com/apiaryio/blog.apiary.io/pull/52","diff_url":"https://github.com/apiaryio/blog.apiary.io/pull/52.diff","patch_url":"https://github.com/apiaryio/blog.apiary.io/pull/52.patch","issue_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/52","number":52,"state":"open","locked":false,"title":"Add a post on Hyperdrive","user":{"login":"kylef","id":44164,"avatar_url":"https://avatars.githubusercontent.com/u/44164?v=3","gravatar_id":"","url":"https://api.github.com/users/kylef","html_url":"https://github.com/kylef","followers_url":"https://api.github.com/users/kylef/followers","following_url":"https://api.github.com/users/kylef/following{/other_user}","gists_url":"https://api.github.com/users/kylef/gists{/gist_id}","starred_url":"https://api.github.com/users/kylef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylef/subscriptions","organizations_url":"https://api.github.com/users/kylef/orgs","repos_url":"https://api.github.com/users/kylef/repos","events_url":"https://api.github.com/users/kylef/events{/privacy}","received_events_url":"https://api.github.com/users/kylef/received_events","type":"User","site_admin":false},"body":"### :warning: Please *DO NOT MERGE*. Pull request is for review only :warning: ","created_at":"2015-05-06T11:25:46Z","updated_at":"2015-05-13T19:47:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8119dfc921511c8959180aab724f974a24a83fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52/commits","review_comments_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52/comments","review_comment_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/52/comments","statuses_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/statuses/b3afcb98487de17dfd8ba672720c7859cdb5086c","head":{"label":"apiaryio:kylef/hyperdrive","ref":"kylef/hyperdrive","sha":"b3afcb98487de17dfd8ba672720c7859cdb5086c","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":1696866,"name":"blog.apiary.io","full_name":"apiaryio/blog.apiary.io","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/blog.apiary.io","description":"Apiary Blog","fork":false,"url":"https://api.github.com/repos/apiaryio/blog.apiary.io","forks_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/forks","keys_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/teams","hooks_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/events","assignees_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/tags","blobs_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/languages","stargazers_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/subscription","commits_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/merges","archive_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/downloads","issues_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/releases{/id}","created_at":"2011-05-03T15:39:36Z","updated_at":"2015-05-06T17:37:26Z","pushed_at":"2015-05-06T17:37:54Z","git_url":"git://github.com/apiaryio/blog.apiary.io.git","ssh_url":"git@github.com:apiaryio/blog.apiary.io.git","clone_url":"https://github.com/apiaryio/blog.apiary.io.git","svn_url":"https://github.com/apiaryio/blog.apiary.io","homepage":"https://blog.apiary.io/","size":19914,"stargazers_count":6,"watchers_count":6,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":6,"default_branch":"master"}},"base":{"label":"apiaryio:master","ref":"master","sha":"f4465a249704f3775a17dfd756637bf541f60660","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":1696866,"name":"blog.apiary.io","full_name":"apiaryio/blog.apiary.io","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/blog.apiary.io","description":"Apiary Blog","fork":false,"url":"https://api.github.com/repos/apiaryio/blog.apiary.io","forks_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/forks","keys_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/teams","hooks_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/events","assignees_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/tags","blobs_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/languages","stargazers_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/subscription","commits_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/merges","archive_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/downloads","issues_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/blog.apiary.io/releases{/id}","created_at":"2011-05-03T15:39:36Z","updated_at":"2015-05-06T17:37:26Z","pushed_at":"2015-05-06T17:37:54Z","git_url":"git://github.com/apiaryio/blog.apiary.io.git","ssh_url":"git@github.com:apiaryio/blog.apiary.io.git","clone_url":"https://github.com/apiaryio/blog.apiary.io.git","svn_url":"https://github.com/apiaryio/blog.apiary.io","homepage":"https://blog.apiary.io/","size":19914,"stargazers_count":6,"watchers_count":6,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52"},"html":{"href":"https://github.com/apiaryio/blog.apiary.io/pull/52"},"issue":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/52"},"comments":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/apiaryio/blog.apiary.io/statuses/b3afcb98487de17dfd8ba672720c7859cdb5086c"}}}}