{"action":"created","comment":{"url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/comments/27835714","id":27835714,"diff_hunk":"@@ -76,13 +77,21 @@ var modelHelper = module.exports = {\n       }\n \n       // Required props sit in a per-model array.\n-      if (prop.required || (prop.id && !prop.generated)) {\n+      if (prop.required) {\n         required.push(key);\n       }\n \n       // Change mismatched keys.\n       prop = translateDataTypeKeys(prop);\n \n+      if (TYPES_PRIMITIVE.indexOf(prop.type) === -1 ){\n+        prop.$ref = prop.type;","path":"lib/model-helper.js","position":21,"original_position":21,"commit_id":"1dbc9cf1136d832878c9d9132ecba2fdf7f1ea6c","original_commit_id":"1dbc9cf1136d832878c9d9132ecba2fdf7f1ea6c","user":{"login":"shelbys","id":1594215,"avatar_url":"https://avatars.githubusercontent.com/u/1594215?v=3","gravatar_id":"","url":"https://api.github.com/users/shelbys","html_url":"https://github.com/shelbys","followers_url":"https://api.github.com/users/shelbys/followers","following_url":"https://api.github.com/users/shelbys/following{/other_user}","gists_url":"https://api.github.com/users/shelbys/gists{/gist_id}","starred_url":"https://api.github.com/users/shelbys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelbys/subscriptions","organizations_url":"https://api.github.com/users/shelbys/orgs","repos_url":"https://api.github.com/users/shelbys/repos","events_url":"https://api.github.com/users/shelbys/events{/privacy}","received_events_url":"https://api.github.com/users/shelbys/received_events","type":"User","site_admin":false},"body":"Changing the property name isn't enough `$ref` needs to be a URI","created_at":"2015-04-06T22:10:46Z","updated_at":"2015-04-06T22:10:46Z","html_url":"https://github.com/shelbys/loopback-explorer/pull/3#discussion_r27835714","pull_request_url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/comments/27835714"},"html":{"href":"https://github.com/shelbys/loopback-explorer/pull/3#discussion_r27835714"},"pull_request":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3","id":32084198,"html_url":"https://github.com/shelbys/loopback-explorer/pull/3","diff_url":"https://github.com/shelbys/loopback-explorer/pull/3.diff","patch_url":"https://github.com/shelbys/loopback-explorer/pull/3.patch","issue_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues/3","number":3,"state":"open","locked":false,"title":"add $ref and remove type for models","user":{"login":"y-tang","id":9506039,"avatar_url":"https://avatars.githubusercontent.com/u/9506039?v=3","gravatar_id":"","url":"https://api.github.com/users/y-tang","html_url":"https://github.com/y-tang","followers_url":"https://api.github.com/users/y-tang/followers","following_url":"https://api.github.com/users/y-tang/following{/other_user}","gists_url":"https://api.github.com/users/y-tang/gists{/gist_id}","starred_url":"https://api.github.com/users/y-tang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-tang/subscriptions","organizations_url":"https://api.github.com/users/y-tang/orgs","repos_url":"https://api.github.com/users/y-tang/repos","events_url":"https://api.github.com/users/y-tang/events{/privacy}","received_events_url":"https://api.github.com/users/y-tang/received_events","type":"User","site_admin":false},"body":"@shelbys review please","created_at":"2015-03-27T05:25:19Z","updated_at":"2015-04-06T22:10:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59a84f31be11ee7ec4ac038a42201af9adfdf008","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3/commits","review_comments_url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3/comments","review_comment_url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues/3/comments","statuses_url":"https://api.github.com/repos/shelbys/loopback-explorer/statuses/1dbc9cf1136d832878c9d9132ecba2fdf7f1ea6c","head":{"label":"shelbys:PLATAPI-1912","ref":"PLATAPI-1912","sha":"1dbc9cf1136d832878c9d9132ecba2fdf7f1ea6c","user":{"login":"shelbys","id":1594215,"avatar_url":"https://avatars.githubusercontent.com/u/1594215?v=3","gravatar_id":"","url":"https://api.github.com/users/shelbys","html_url":"https://github.com/shelbys","followers_url":"https://api.github.com/users/shelbys/followers","following_url":"https://api.github.com/users/shelbys/following{/other_user}","gists_url":"https://api.github.com/users/shelbys/gists{/gist_id}","starred_url":"https://api.github.com/users/shelbys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelbys/subscriptions","organizations_url":"https://api.github.com/users/shelbys/orgs","repos_url":"https://api.github.com/users/shelbys/repos","events_url":"https://api.github.com/users/shelbys/events{/privacy}","received_events_url":"https://api.github.com/users/shelbys/received_events","type":"User","site_admin":false},"repo":{"id":21648165,"name":"loopback-explorer","full_name":"shelbys/loopback-explorer","owner":{"login":"shelbys","id":1594215,"avatar_url":"https://avatars.githubusercontent.com/u/1594215?v=3","gravatar_id":"","url":"https://api.github.com/users/shelbys","html_url":"https://github.com/shelbys","followers_url":"https://api.github.com/users/shelbys/followers","following_url":"https://api.github.com/users/shelbys/following{/other_user}","gists_url":"https://api.github.com/users/shelbys/gists{/gist_id}","starred_url":"https://api.github.com/users/shelbys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelbys/subscriptions","organizations_url":"https://api.github.com/users/shelbys/orgs","repos_url":"https://api.github.com/users/shelbys/repos","events_url":"https://api.github.com/users/shelbys/events{/privacy}","received_events_url":"https://api.github.com/users/shelbys/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shelbys/loopback-explorer","description":"Browse and test your LoopBack app's APIs","fork":true,"url":"https://api.github.com/repos/shelbys/loopback-explorer","forks_url":"https://api.github.com/repos/shelbys/loopback-explorer/forks","keys_url":"https://api.github.com/repos/shelbys/loopback-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shelbys/loopback-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shelbys/loopback-explorer/teams","hooks_url":"https://api.github.com/repos/shelbys/loopback-explorer/hooks","issue_events_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/shelbys/loopback-explorer/events","assignees_url":"https://api.github.com/repos/shelbys/loopback-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/shelbys/loopback-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/shelbys/loopback-explorer/tags","blobs_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shelbys/loopback-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/shelbys/loopback-explorer/languages","stargazers_url":"https://api.github.com/repos/shelbys/loopback-explorer/stargazers","contributors_url":"https://api.github.com/repos/shelbys/loopback-explorer/contributors","subscribers_url":"https://api.github.com/repos/shelbys/loopback-explorer/subscribers","subscription_url":"https://api.github.com/repos/shelbys/loopback-explorer/subscription","commits_url":"https://api.github.com/repos/shelbys/loopback-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/shelbys/loopback-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/shelbys/loopback-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/shelbys/loopback-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shelbys/loopback-explorer/merges","archive_url":"https://api.github.com/repos/shelbys/loopback-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shelbys/loopback-explorer/downloads","issues_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/shelbys/loopback-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/shelbys/loopback-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shelbys/loopback-explorer/labels{/name}","releases_url":"https://api.github.com/repos/shelbys/loopback-explorer/releases{/id}","created_at":"2014-07-09T10:18:16Z","updated_at":"2015-02-08T06:59:18Z","pushed_at":"2015-04-06T00:04:40Z","git_url":"git://github.com/shelbys/loopback-explorer.git","ssh_url":"git@github.com:shelbys/loopback-explorer.git","clone_url":"https://github.com/shelbys/loopback-explorer.git","svn_url":"https://github.com/shelbys/loopback-explorer","homepage":null,"size":722,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"shelbys:master","ref":"master","sha":"fa0c8d160abe25ee59d5acb7bbc7a98d9bb2bfda","user":{"login":"shelbys","id":1594215,"avatar_url":"https://avatars.githubusercontent.com/u/1594215?v=3","gravatar_id":"","url":"https://api.github.com/users/shelbys","html_url":"https://github.com/shelbys","followers_url":"https://api.github.com/users/shelbys/followers","following_url":"https://api.github.com/users/shelbys/following{/other_user}","gists_url":"https://api.github.com/users/shelbys/gists{/gist_id}","starred_url":"https://api.github.com/users/shelbys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelbys/subscriptions","organizations_url":"https://api.github.com/users/shelbys/orgs","repos_url":"https://api.github.com/users/shelbys/repos","events_url":"https://api.github.com/users/shelbys/events{/privacy}","received_events_url":"https://api.github.com/users/shelbys/received_events","type":"User","site_admin":false},"repo":{"id":21648165,"name":"loopback-explorer","full_name":"shelbys/loopback-explorer","owner":{"login":"shelbys","id":1594215,"avatar_url":"https://avatars.githubusercontent.com/u/1594215?v=3","gravatar_id":"","url":"https://api.github.com/users/shelbys","html_url":"https://github.com/shelbys","followers_url":"https://api.github.com/users/shelbys/followers","following_url":"https://api.github.com/users/shelbys/following{/other_user}","gists_url":"https://api.github.com/users/shelbys/gists{/gist_id}","starred_url":"https://api.github.com/users/shelbys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelbys/subscriptions","organizations_url":"https://api.github.com/users/shelbys/orgs","repos_url":"https://api.github.com/users/shelbys/repos","events_url":"https://api.github.com/users/shelbys/events{/privacy}","received_events_url":"https://api.github.com/users/shelbys/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shelbys/loopback-explorer","description":"Browse and test your LoopBack app's APIs","fork":true,"url":"https://api.github.com/repos/shelbys/loopback-explorer","forks_url":"https://api.github.com/repos/shelbys/loopback-explorer/forks","keys_url":"https://api.github.com/repos/shelbys/loopback-explorer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shelbys/loopback-explorer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shelbys/loopback-explorer/teams","hooks_url":"https://api.github.com/repos/shelbys/loopback-explorer/hooks","issue_events_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues/events{/number}","events_url":"https://api.github.com/repos/shelbys/loopback-explorer/events","assignees_url":"https://api.github.com/repos/shelbys/loopback-explorer/assignees{/user}","branches_url":"https://api.github.com/repos/shelbys/loopback-explorer/branches{/branch}","tags_url":"https://api.github.com/repos/shelbys/loopback-explorer/tags","blobs_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/refs{/sha}","trees_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shelbys/loopback-explorer/statuses/{sha}","languages_url":"https://api.github.com/repos/shelbys/loopback-explorer/languages","stargazers_url":"https://api.github.com/repos/shelbys/loopback-explorer/stargazers","contributors_url":"https://api.github.com/repos/shelbys/loopback-explorer/contributors","subscribers_url":"https://api.github.com/repos/shelbys/loopback-explorer/subscribers","subscription_url":"https://api.github.com/repos/shelbys/loopback-explorer/subscription","commits_url":"https://api.github.com/repos/shelbys/loopback-explorer/commits{/sha}","git_commits_url":"https://api.github.com/repos/shelbys/loopback-explorer/git/commits{/sha}","comments_url":"https://api.github.com/repos/shelbys/loopback-explorer/comments{/number}","issue_comment_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues/comments{/number}","contents_url":"https://api.github.com/repos/shelbys/loopback-explorer/contents/{+path}","compare_url":"https://api.github.com/repos/shelbys/loopback-explorer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shelbys/loopback-explorer/merges","archive_url":"https://api.github.com/repos/shelbys/loopback-explorer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shelbys/loopback-explorer/downloads","issues_url":"https://api.github.com/repos/shelbys/loopback-explorer/issues{/number}","pulls_url":"https://api.github.com/repos/shelbys/loopback-explorer/pulls{/number}","milestones_url":"https://api.github.com/repos/shelbys/loopback-explorer/milestones{/number}","notifications_url":"https://api.github.com/repos/shelbys/loopback-explorer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shelbys/loopback-explorer/labels{/name}","releases_url":"https://api.github.com/repos/shelbys/loopback-explorer/releases{/id}","created_at":"2014-07-09T10:18:16Z","updated_at":"2015-02-08T06:59:18Z","pushed_at":"2015-04-06T00:04:40Z","git_url":"git://github.com/shelbys/loopback-explorer.git","ssh_url":"git@github.com:shelbys/loopback-explorer.git","clone_url":"https://github.com/shelbys/loopback-explorer.git","svn_url":"https://github.com/shelbys/loopback-explorer","homepage":null,"size":722,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3"},"html":{"href":"https://github.com/shelbys/loopback-explorer/pull/3"},"issue":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/issues/3"},"comments":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/shelbys/loopback-explorer/statuses/1dbc9cf1136d832878c9d9132ecba2fdf7f1ea6c"}}}}