{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments/217827148","pull_request_review_id":155642173,"id":217827148,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzgyNzE0OA==","diff_hunk":"@@ -137,6 +137,32 @@ export class ModelDefinition {\n   }\n }\n \n+function asJSON(value: any): any {\n+  if (value == null) return value;\n+  if (typeof value.toJSON === 'function') {\n+    return value.toJSON();\n+  }\n+  // Handle arrays\n+  if (Array.isArray(value)) {\n+    return value.map(item => asJSON(item));\n+  }\n+  return value;\n+}\n+\n+function asObject(value: any, options?: Options): any {\n+  if (value == null) return value;","path":"packages/repository/src/model.ts","position":17,"original_position":17,"commit_id":"efea8632dfc0457d5da77cc1eee00e40600f4625","original_commit_id":"efea8632dfc0457d5da77cc1eee00e40600f4625","user":{"login":"jannyHou","id":12554153,"node_id":"MDQ6VXNlcjEyNTU0MTUz","avatar_url":"https://avatars0.githubusercontent.com/u/12554153?v=4","gravatar_id":"","url":"https://api.github.com/users/jannyHou","html_url":"https://github.com/jannyHou","followers_url":"https://api.github.com/users/jannyHou/followers","following_url":"https://api.github.com/users/jannyHou/following{/other_user}","gists_url":"https://api.github.com/users/jannyHou/gists{/gist_id}","starred_url":"https://api.github.com/users/jannyHou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jannyHou/subscriptions","organizations_url":"https://api.github.com/users/jannyHou/orgs","repos_url":"https://api.github.com/users/jannyHou/repos","events_url":"https://api.github.com/users/jannyHou/events{/privacy}","received_events_url":"https://api.github.com/users/jannyHou/received_events","type":"User","site_admin":false},"body":"Does `asObject` need check the flag for unknown properties as well like `toObject`?\r\n\r\n`if (options && options.ignoreUnknownProperties === false) { // do the convertion}`","created_at":"2018-09-14T20:01:49Z","updated_at":"2018-09-14T20:01:49Z","html_url":"https://github.com/strongloop/loopback-next/pull/1712#discussion_r217827148","pull_request_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments/217827148"},"html":{"href":"https://github.com/strongloop/loopback-next/pull/1712#discussion_r217827148"},"pull_request":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712"}}},"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712","id":215694019,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1Njk0MDE5","html_url":"https://github.com/strongloop/loopback-next/pull/1712","diff_url":"https://github.com/strongloop/loopback-next/pull/1712.diff","patch_url":"https://github.com/strongloop/loopback-next/pull/1712.patch","issue_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1712","number":1712,"state":"open","locked":false,"title":"fix(repository): convert array items to json","user":{"login":"raymondfeng","id":540892,"node_id":"MDQ6VXNlcjU0MDg5Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/540892?v=4","gravatar_id":"","url":"https://api.github.com/users/raymondfeng","html_url":"https://github.com/raymondfeng","followers_url":"https://api.github.com/users/raymondfeng/followers","following_url":"https://api.github.com/users/raymondfeng/following{/other_user}","gists_url":"https://api.github.com/users/raymondfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondfeng/subscriptions","organizations_url":"https://api.github.com/users/raymondfeng/orgs","repos_url":"https://api.github.com/users/raymondfeng/repos","events_url":"https://api.github.com/users/raymondfeng/events{/privacy}","received_events_url":"https://api.github.com/users/raymondfeng/received_events","type":"User","site_admin":false},"body":"A follow-up to #1711. This PR fixes the array conversion.\r\n\r\n## Checklist\r\n\r\n- [x] `npm test` passes on your machine\r\n- [x] New tests added or existing tests modified to cover all changes\r\n- [x] Code conforms with the [style guide](http://loopback.io/doc/en/contrib/style-guide.html)\r\n- [x] API Documentation in code was updated\r\n- [ ] Documentation in [/docs/site](../tree/master/docs/site) was updated\r\n- [ ] Affected artifact templates in `packages/cli` were updated\r\n- [ ] Affected example projects in `examples/*` were updated\r\n","created_at":"2018-09-14T19:50:25Z","updated_at":"2018-09-14T20:01:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90a0bdd08f14a834e6849dfe6cc89d764422f891","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bajtos","id":1140553,"node_id":"MDQ6VXNlcjExNDA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1140553?v=4","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712/commits","review_comments_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712/comments","review_comment_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1712/comments","statuses_url":"https://api.github.com/repos/strongloop/loopback-next/statuses/efea8632dfc0457d5da77cc1eee00e40600f4625","head":{"label":"strongloop:fix-array-to-json","ref":"fix-array-to-json","sha":"efea8632dfc0457d5da77cc1eee00e40600f4625","user":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":78452015,"node_id":"MDEwOlJlcG9zaXRvcnk3ODQ1MjAxNQ==","name":"loopback-next","full_name":"strongloop/loopback-next","owner":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-next","description":"LoopBack makes it easy to build modern API applications that require complex integrations.","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-next","forks_url":"https://api.github.com/repos/strongloop/loopback-next/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-next/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-next/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-next/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-next/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-next/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-next/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-next/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-next/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-next/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-next/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-next/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-next/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-next/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-next/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-next/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-next/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-next/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-next/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-next/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-next/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/loopback-next/deployments","created_at":"2017-01-09T17:27:14Z","updated_at":"2018-09-14T19:22:17Z","pushed_at":"2018-09-14T19:50:26Z","git_url":"git://github.com/strongloop/loopback-next.git","ssh_url":"git@github.com:strongloop/loopback-next.git","clone_url":"https://github.com/strongloop/loopback-next.git","svn_url":"https://github.com/strongloop/loopback-next","homepage":"http://loopback.io","size":8312,"stargazers_count":813,"watchers_count":813,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"archived":false,"open_issues_count":243,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":89,"open_issues":243,"watchers":813,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"38d3ec772a3f69e7dacb735a88ecd19b1f535191","user":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":78452015,"node_id":"MDEwOlJlcG9zaXRvcnk3ODQ1MjAxNQ==","name":"loopback-next","full_name":"strongloop/loopback-next","owner":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-next","description":"LoopBack makes it easy to build modern API applications that require complex integrations.","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-next","forks_url":"https://api.github.com/repos/strongloop/loopback-next/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-next/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-next/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-next/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-next/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-next/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-next/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-next/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-next/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-next/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-next/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-next/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-next/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-next/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-next/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-next/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-next/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-next/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-next/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-next/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-next/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/loopback-next/deployments","created_at":"2017-01-09T17:27:14Z","updated_at":"2018-09-14T19:22:17Z","pushed_at":"2018-09-14T19:50:26Z","git_url":"git://github.com/strongloop/loopback-next.git","ssh_url":"git@github.com:strongloop/loopback-next.git","clone_url":"https://github.com/strongloop/loopback-next.git","svn_url":"https://github.com/strongloop/loopback-next","homepage":"http://loopback.io","size":8312,"stargazers_count":813,"watchers_count":813,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"archived":false,"open_issues_count":243,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":89,"open_issues":243,"watchers":813,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712"},"html":{"href":"https://github.com/strongloop/loopback-next/pull/1712"},"issue":{"href":"https://api.github.com/repos/strongloop/loopback-next/issues/1712"},"comments":{"href":"https://api.github.com/repos/strongloop/loopback-next/issues/1712/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1712/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/loopback-next/statuses/efea8632dfc0457d5da77cc1eee00e40600f4625"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jannyHou"}}