{"action":"created","comment":{"url":"https://api.github.com/repos/c5t/Current/pulls/comments/50037488","id":50037488,"diff_hunk":"@@ -0,0 +1,183 @@\n+# RESTful binding for Storage, RFC\n+\n+This document describes the RESTful API with CRUD functionality for Current Storage.\n+\n+### Bindings semantics\n+`TODO: Describe storage field <-> endpoint bindings.`\n+\n+### Response schema\n+\n+The response body is always either a valid JSON or empty.\n+\n+The generic format of a successful JSON response is:\n+\n+```\n+{\n+  \"url\": \"https://api.example.com/...\",\n+  \"url_*\": \"https://api.example.com/...\",\n+  ... more \"url_*\" fields ...\n+  \n+  [optional]\n+  \"meta\": {\n+    ...\n+  },\n+  \n+  [required]\n+  \"data\": {\n+    ...\n+  }\n+\n+}\n+```\n+\n+The responses are strongly typed. The contents of the request URL define the schema for the response.\n+\n+The value for `\"data\"` can be:\n+* an object,\n+* an array, if the response is expected to contain a list,\n+* primitive type (string, number, boolean) in special cases.\n+\n+Error responses are JSON objects with the top-level `\"error\":...` field:\n+\n+```\n+{\n+  “error”: “Detailed human-readable error message.”,\n+  ... other fields ...\n+}\n+```\n+\n+Successful responses are JSON objects without the top-level `\"error\"` field.\n+\n+`TODO: We also may have redirects, which contain the \"Location\" in the header, with empty body.`\n+\n+### Notation\n+\n+The default way to encode JSON objects is JavaScript-friendly. The API also supports F#-friendly format.\n+\n+The differences are:\n+\n+1. Variant types.\n+\n+   If a field `x` can be either an `apple` or an `orange`, the JavaScript-friendly representation is `{...,\"x\":{\"apple\":{...},...}`, and the F#-friendly representation is `{...,\"x\":{\"Case\":\"apple\",\"Fields\":[...]},...}}`.\n+\n+2. Coding of absent optional objects.\n+\n+   The JavaScript-friendly implementation omits missing fields from the output (and does not expect them in the input).\n+The F#-friendly implementation outputs missing fields as `null`-s (and expects `null`-s in the input).\n+\n+3. Coding of dictionaries with the keys being strings.\n+\n+   Generally, both JavaScript- and F#-friendly implementations encode dictionaries as arrays of arrays of two elements: `[[key1,value1],[key2,value2],...]`.\n+   \n+   However, if the type of `key` is string, the JavaScript-friendly format of this dictionary becomes an object: `{\"key1\":value1,\"key2\":value2,...}`.\n+\n+   `TODO(dkorolev): Check if some other F#-related issues should be added into this section.`\n+\n+### Views\n+\n+**View** is a representation of a record, which contains some non-empty subset of the record’s fields.\n+The API supports different views via the `&format=...` URL parameter.\n+\n+By default, records returned by the API contain all fields.\n+\n+Two implicitly defined views (both default to \"all fields\") are `full` and `preview`.\n+\n+The `full` view is the default, so that `&format=full` is equivalent to not specifying the `&format` URL parameter.\n+\n+The `&format=preview` is used when the response schema for certain endpoint contains not one record, but a collection of them. In other words, the representation of each record of `\"data\":[...]` for the endpoints where `\"data\"` is an array is equivalent to the representation of those records with `&format=preview`.\n+\n+The views are defined by the user, and the default representation of any view is \"all fields\". In particular, unless the user defines the `\"preview\"` view, it will be identical to the `\"full\"` one.","path":"Storage/REST-API.md","position":89,"original_position":89,"commit_id":"aaf0f926f0ec6400b06a945367f4ecb46f14d0ea","original_commit_id":"aaf0f926f0ec6400b06a945367f4ecb46f14d0ea","user":{"login":"sompylasar","id":498274,"avatar_url":"https://avatars.githubusercontent.com/u/498274?v=3","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"body":"Can the user define a custom view, beyond `full` and `preview`?","created_at":"2016-01-18T19:48:21Z","updated_at":"2016-01-18T19:48:21Z","html_url":"https://github.com/c5t/Current/pull/346#discussion_r50037488","pull_request_url":"https://api.github.com/repos/c5t/Current/pulls/346","_links":{"self":{"href":"https://api.github.com/repos/c5t/Current/pulls/comments/50037488"},"html":{"href":"https://github.com/c5t/Current/pull/346#discussion_r50037488"},"pull_request":{"href":"https://api.github.com/repos/c5t/Current/pulls/346"}}},"pull_request":{"url":"https://api.github.com/repos/c5t/Current/pulls/346","id":56378885,"html_url":"https://github.com/c5t/Current/pull/346","diff_url":"https://github.com/c5t/Current/pull/346.diff","patch_url":"https://github.com/c5t/Current/pull/346.patch","issue_url":"https://api.github.com/repos/c5t/Current/issues/346","number":346,"state":"open","locked":false,"title":"Storage RESTful API design doc.","user":{"login":"mzhurovich","id":11226961,"avatar_url":"https://avatars.githubusercontent.com/u/11226961?v=3","gravatar_id":"","url":"https://api.github.com/users/mzhurovich","html_url":"https://github.com/mzhurovich","followers_url":"https://api.github.com/users/mzhurovich/followers","following_url":"https://api.github.com/users/mzhurovich/following{/other_user}","gists_url":"https://api.github.com/users/mzhurovich/gists{/gist_id}","starred_url":"https://api.github.com/users/mzhurovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzhurovich/subscriptions","organizations_url":"https://api.github.com/users/mzhurovich/orgs","repos_url":"https://api.github.com/users/mzhurovich/repos","events_url":"https://api.github.com/users/mzhurovich/events{/privacy}","received_events_url":"https://api.github.com/users/mzhurovich/received_events","type":"User","site_admin":false},"body":"Hi, @dkorolev!\r\nI took the liberty of summarizing our Google Docs drafts into this design doc.\r\nPTAL, if everything is described correctly.\r\nFixes/additions/comments are highly appreciated :)\r\nThanks!","created_at":"2016-01-18T18:49:35Z","updated_at":"2016-01-18T19:48:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e93535d17eb7f76f304f6564dbd56b6e876b2fd2","assignee":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/c5t/Current/pulls/346/commits","review_comments_url":"https://api.github.com/repos/c5t/Current/pulls/346/comments","review_comment_url":"https://api.github.com/repos/c5t/Current/pulls/comments{/number}","comments_url":"https://api.github.com/repos/c5t/Current/issues/346/comments","statuses_url":"https://api.github.com/repos/c5t/Current/statuses/aaf0f926f0ec6400b06a945367f4ecb46f14d0ea","head":{"label":"mzhurovich:storage_rest","ref":"storage_rest","sha":"aaf0f926f0ec6400b06a945367f4ecb46f14d0ea","user":{"login":"mzhurovich","id":11226961,"avatar_url":"https://avatars.githubusercontent.com/u/11226961?v=3","gravatar_id":"","url":"https://api.github.com/users/mzhurovich","html_url":"https://github.com/mzhurovich","followers_url":"https://api.github.com/users/mzhurovich/followers","following_url":"https://api.github.com/users/mzhurovich/following{/other_user}","gists_url":"https://api.github.com/users/mzhurovich/gists{/gist_id}","starred_url":"https://api.github.com/users/mzhurovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzhurovich/subscriptions","organizations_url":"https://api.github.com/users/mzhurovich/orgs","repos_url":"https://api.github.com/users/mzhurovich/repos","events_url":"https://api.github.com/users/mzhurovich/events{/privacy}","received_events_url":"https://api.github.com/users/mzhurovich/received_events","type":"User","site_admin":false},"repo":{"id":31462826,"name":"Current","full_name":"mzhurovich/Current","owner":{"login":"mzhurovich","id":11226961,"avatar_url":"https://avatars.githubusercontent.com/u/11226961?v=3","gravatar_id":"","url":"https://api.github.com/users/mzhurovich","html_url":"https://github.com/mzhurovich","followers_url":"https://api.github.com/users/mzhurovich/followers","following_url":"https://api.github.com/users/mzhurovich/following{/other_user}","gists_url":"https://api.github.com/users/mzhurovich/gists{/gist_id}","starred_url":"https://api.github.com/users/mzhurovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzhurovich/subscriptions","organizations_url":"https://api.github.com/users/mzhurovich/orgs","repos_url":"https://api.github.com/users/mzhurovich/repos","events_url":"https://api.github.com/users/mzhurovich/events{/privacy}","received_events_url":"https://api.github.com/users/mzhurovich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mzhurovich/Current","description":"Our own core pieces to reuse.","fork":true,"url":"https://api.github.com/repos/mzhurovich/Current","forks_url":"https://api.github.com/repos/mzhurovich/Current/forks","keys_url":"https://api.github.com/repos/mzhurovich/Current/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mzhurovich/Current/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mzhurovich/Current/teams","hooks_url":"https://api.github.com/repos/mzhurovich/Current/hooks","issue_events_url":"https://api.github.com/repos/mzhurovich/Current/issues/events{/number}","events_url":"https://api.github.com/repos/mzhurovich/Current/events","assignees_url":"https://api.github.com/repos/mzhurovich/Current/assignees{/user}","branches_url":"https://api.github.com/repos/mzhurovich/Current/branches{/branch}","tags_url":"https://api.github.com/repos/mzhurovich/Current/tags","blobs_url":"https://api.github.com/repos/mzhurovich/Current/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mzhurovich/Current/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mzhurovich/Current/git/refs{/sha}","trees_url":"https://api.github.com/repos/mzhurovich/Current/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mzhurovich/Current/statuses/{sha}","languages_url":"https://api.github.com/repos/mzhurovich/Current/languages","stargazers_url":"https://api.github.com/repos/mzhurovich/Current/stargazers","contributors_url":"https://api.github.com/repos/mzhurovich/Current/contributors","subscribers_url":"https://api.github.com/repos/mzhurovich/Current/subscribers","subscription_url":"https://api.github.com/repos/mzhurovich/Current/subscription","commits_url":"https://api.github.com/repos/mzhurovich/Current/commits{/sha}","git_commits_url":"https://api.github.com/repos/mzhurovich/Current/git/commits{/sha}","comments_url":"https://api.github.com/repos/mzhurovich/Current/comments{/number}","issue_comment_url":"https://api.github.com/repos/mzhurovich/Current/issues/comments{/number}","contents_url":"https://api.github.com/repos/mzhurovich/Current/contents/{+path}","compare_url":"https://api.github.com/repos/mzhurovich/Current/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mzhurovich/Current/merges","archive_url":"https://api.github.com/repos/mzhurovich/Current/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mzhurovich/Current/downloads","issues_url":"https://api.github.com/repos/mzhurovich/Current/issues{/number}","pulls_url":"https://api.github.com/repos/mzhurovich/Current/pulls{/number}","milestones_url":"https://api.github.com/repos/mzhurovich/Current/milestones{/number}","notifications_url":"https://api.github.com/repos/mzhurovich/Current/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mzhurovich/Current/labels{/name}","releases_url":"https://api.github.com/repos/mzhurovich/Current/releases{/id}","created_at":"2015-02-28T13:03:55Z","updated_at":"2015-05-24T23:39:55Z","pushed_at":"2016-01-18T18:45:47Z","git_url":"git://github.com/mzhurovich/Current.git","ssh_url":"git@github.com:mzhurovich/Current.git","clone_url":"https://github.com/mzhurovich/Current.git","svn_url":"https://github.com/mzhurovich/Current","homepage":null,"size":9706,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"c5t:master","ref":"master","sha":"30df7157c34c328e0c3548c0151f8e52c8e5c525","user":{"login":"c5t","id":12224789,"avatar_url":"https://avatars.githubusercontent.com/u/12224789?v=3","gravatar_id":"","url":"https://api.github.com/users/c5t","html_url":"https://github.com/c5t","followers_url":"https://api.github.com/users/c5t/followers","following_url":"https://api.github.com/users/c5t/following{/other_user}","gists_url":"https://api.github.com/users/c5t/gists{/gist_id}","starred_url":"https://api.github.com/users/c5t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c5t/subscriptions","organizations_url":"https://api.github.com/users/c5t/orgs","repos_url":"https://api.github.com/users/c5t/repos","events_url":"https://api.github.com/users/c5t/events{/privacy}","received_events_url":"https://api.github.com/users/c5t/received_events","type":"Organization","site_admin":false},"repo":{"id":27625425,"name":"Current","full_name":"c5t/Current","owner":{"login":"c5t","id":12224789,"avatar_url":"https://avatars.githubusercontent.com/u/12224789?v=3","gravatar_id":"","url":"https://api.github.com/users/c5t","html_url":"https://github.com/c5t","followers_url":"https://api.github.com/users/c5t/followers","following_url":"https://api.github.com/users/c5t/following{/other_user}","gists_url":"https://api.github.com/users/c5t/gists{/gist_id}","starred_url":"https://api.github.com/users/c5t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c5t/subscriptions","organizations_url":"https://api.github.com/users/c5t/orgs","repos_url":"https://api.github.com/users/c5t/repos","events_url":"https://api.github.com/users/c5t/events{/privacy}","received_events_url":"https://api.github.com/users/c5t/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/c5t/Current","description":"Data Infrastructure in a Box:","fork":false,"url":"https://api.github.com/repos/c5t/Current","forks_url":"https://api.github.com/repos/c5t/Current/forks","keys_url":"https://api.github.com/repos/c5t/Current/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c5t/Current/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c5t/Current/teams","hooks_url":"https://api.github.com/repos/c5t/Current/hooks","issue_events_url":"https://api.github.com/repos/c5t/Current/issues/events{/number}","events_url":"https://api.github.com/repos/c5t/Current/events","assignees_url":"https://api.github.com/repos/c5t/Current/assignees{/user}","branches_url":"https://api.github.com/repos/c5t/Current/branches{/branch}","tags_url":"https://api.github.com/repos/c5t/Current/tags","blobs_url":"https://api.github.com/repos/c5t/Current/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c5t/Current/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c5t/Current/git/refs{/sha}","trees_url":"https://api.github.com/repos/c5t/Current/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c5t/Current/statuses/{sha}","languages_url":"https://api.github.com/repos/c5t/Current/languages","stargazers_url":"https://api.github.com/repos/c5t/Current/stargazers","contributors_url":"https://api.github.com/repos/c5t/Current/contributors","subscribers_url":"https://api.github.com/repos/c5t/Current/subscribers","subscription_url":"https://api.github.com/repos/c5t/Current/subscription","commits_url":"https://api.github.com/repos/c5t/Current/commits{/sha}","git_commits_url":"https://api.github.com/repos/c5t/Current/git/commits{/sha}","comments_url":"https://api.github.com/repos/c5t/Current/comments{/number}","issue_comment_url":"https://api.github.com/repos/c5t/Current/issues/comments{/number}","contents_url":"https://api.github.com/repos/c5t/Current/contents/{+path}","compare_url":"https://api.github.com/repos/c5t/Current/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c5t/Current/merges","archive_url":"https://api.github.com/repos/c5t/Current/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c5t/Current/downloads","issues_url":"https://api.github.com/repos/c5t/Current/issues{/number}","pulls_url":"https://api.github.com/repos/c5t/Current/pulls{/number}","milestones_url":"https://api.github.com/repos/c5t/Current/milestones{/number}","notifications_url":"https://api.github.com/repos/c5t/Current/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c5t/Current/labels{/name}","releases_url":"https://api.github.com/repos/c5t/Current/releases{/id}","created_at":"2014-12-06T06:52:23Z","updated_at":"2016-01-17T03:27:28Z","pushed_at":"2016-01-18T18:49:35Z","git_url":"git://github.com/c5t/Current.git","ssh_url":"git@github.com:c5t/Current.git","clone_url":"https://github.com/c5t/Current.git","svn_url":"https://github.com/c5t/Current","homepage":"https://j.mp/currentintelligence","size":9751,"stargazers_count":24,"watchers_count":24,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":36,"forks":9,"open_issues":36,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/c5t/Current/pulls/346"},"html":{"href":"https://github.com/c5t/Current/pull/346"},"issue":{"href":"https://api.github.com/repos/c5t/Current/issues/346"},"comments":{"href":"https://api.github.com/repos/c5t/Current/issues/346/comments"},"review_comments":{"href":"https://api.github.com/repos/c5t/Current/pulls/346/comments"},"review_comment":{"href":"https://api.github.com/repos/c5t/Current/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/c5t/Current/pulls/346/commits"},"statuses":{"href":"https://api.github.com/repos/c5t/Current/statuses/aaf0f926f0ec6400b06a945367f4ecb46f14d0ea"}}}}