{"action":"created","comment":{"url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/comments/207903649","pull_request_review_id":143595869,"id":207903649,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzkwMzY0OQ==","diff_hunk":"@@ -99,14 +159,106 @@ Errors::eType CObjectSchemaItem::validate(const SmartObject& object,\n   return Errors::OK;\n }\n \n-void CObjectSchemaItem::applySchema(SmartObject& Object,\n-                                    const bool RemoveFakeParameters) {\n+Errors::eType CObjectSchemaItem::validate(\n+    const SmartObject& object,\n+    rpc::ValidationReport* report__,\n+    const utils::SemanticVersion& MessageVersion) {\n+  if (SmartType_Map != object.getType()) {\n+    std::string validation_info = \"Incorrect type, expected: \" +\n+                                  SmartObject::typeToString(SmartType_Map) +\n+                                  \", got: \" +\n+                                  SmartObject::typeToString(object.getType());\n+    report__->set_validation_info(validation_info);\n+    return Errors::INVALID_VALUE;\n+  }\n+\n+  std::set<std::string> object_keys = object.enumerate();\n+\n+  for (Members::const_iterator it = mMembers.begin(); it != mMembers.end();\n+       ++it) {\n+    const std::string& key = it->first;\n+    const SMember& member = it->second;\n+    std::set<std::string>::const_iterator key_it = object_keys.find(key);\n+    if (object_keys.end() == key_it) {\n+      if (member.mSince.is_initialized() &&\n+          MessageVersion < member.mSince.get() &&\n+          member.mHistoryVector.size() > 0) {\n+        // Message version predates parameter and a history vector exists.\n+        for (uint i = 0; i < member.mHistoryVector.size(); i++) {\n+          if (member.mHistoryVector[i].mSince.is_initialized() &&\n+              MessageVersion >= member.mHistoryVector[i].mSince.get()) {\n+            if (member.mHistoryVector[i].mUntil.is_initialized() &&\n+                MessageVersion >= member.mHistoryVector[i].mUntil.get()) {\n+              // MessageVersion is newer than the specified \"Until\" version\n+              continue;\n+            } else {\n+              if (member.mHistoryVector[i].mIsMandatory == true &&\n+                  (member.mHistoryVector[i].mIsRemoved == false)) {\n+                std::string validation_info =","path":"src/components/smart_objects/src/object_schema_item.cc","position":121,"original_position":121,"commit_id":"15ab4952f6825c6829aa0fada94d4a97422b2b12","original_commit_id":"15ab4952f6825c6829aa0fada94d4a97422b2b12","user":{"login":"LuxoftAKutsan","id":11158563,"node_id":"MDQ6VXNlcjExMTU4NTYz","avatar_url":"https://avatars1.githubusercontent.com/u/11158563?v=4","gravatar_id":"","url":"https://api.github.com/users/LuxoftAKutsan","html_url":"https://github.com/LuxoftAKutsan","followers_url":"https://api.github.com/users/LuxoftAKutsan/followers","following_url":"https://api.github.com/users/LuxoftAKutsan/following{/other_user}","gists_url":"https://api.github.com/users/LuxoftAKutsan/gists{/gist_id}","starred_url":"https://api.github.com/users/LuxoftAKutsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LuxoftAKutsan/subscriptions","organizations_url":"https://api.github.com/users/LuxoftAKutsan/orgs","repos_url":"https://api.github.com/users/LuxoftAKutsan/repos","events_url":"https://api.github.com/users/LuxoftAKutsan/events{/privacy}","received_events_url":"https://api.github.com/users/LuxoftAKutsan/received_events","type":"User","site_admin":false},"body":"@JackLivio is it possible to refactor so complicated method to multiple methods, maybe lambdas ?","created_at":"2018-08-06T14:07:55Z","updated_at":"2018-08-06T14:09:03Z","html_url":"https://github.com/smartdevicelink/sdl_core/pull/2497#discussion_r207903649","pull_request_url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/comments/207903649"},"html":{"href":"https://github.com/smartdevicelink/sdl_core/pull/2497#discussion_r207903649"},"pull_request":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497"}}},"pull_request":{"url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497","id":206400092,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDAwMDky","html_url":"https://github.com/smartdevicelink/sdl_core/pull/2497","diff_url":"https://github.com/smartdevicelink/sdl_core/pull/2497.diff","patch_url":"https://github.com/smartdevicelink/sdl_core/pull/2497.patch","issue_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/2497","number":2497,"state":"open","locked":false,"title":"Mobile API Versioning Implementation","user":{"login":"JackLivio","id":12038416,"node_id":"MDQ6VXNlcjEyMDM4NDE2","avatar_url":"https://avatars0.githubusercontent.com/u/12038416?v=4","gravatar_id":"","url":"https://api.github.com/users/JackLivio","html_url":"https://github.com/JackLivio","followers_url":"https://api.github.com/users/JackLivio/followers","following_url":"https://api.github.com/users/JackLivio/following{/other_user}","gists_url":"https://api.github.com/users/JackLivio/gists{/gist_id}","starred_url":"https://api.github.com/users/JackLivio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackLivio/subscriptions","organizations_url":"https://api.github.com/users/JackLivio/orgs","repos_url":"https://api.github.com/users/JackLivio/repos","events_url":"https://api.github.com/users/JackLivio/events{/privacy}","received_events_url":"https://api.github.com/users/JackLivio/received_events","type":"User","site_admin":false},"body":"\r\n\r\nFixes #2248 \r\n\r\nThis PR is **ready** for review.\r\n\r\n### Risk\r\nThis PR makes **major** API changes.\r\n\r\n### Testing Plan\r\nRun Unit Tests\r\nRun ATF Tests\r\nManually connect apps with different SyncMsgVersions\r\n\r\n### Summary\r\nImplements [proposal for Mobile API Versioning](https://github.com/smartdevicelink/sdl_core/issues/2248)\r\n\r\n- Adds support for a \"minVersion\" of an interface. Rejects app if lower than minVersion\r\n- Adds element signatures for keywords: since, until, deprecated, removed, and history\r\n- Negotiates SyncMsgVersion during RegisterAppInterface\r\n- Uses history subelement to validate params based on api versioning.\r\n- Uses history subelement to validate enum elements\r\n\r\n### Changelog\r\n##### Breaking Changes\r\n- Apps must send appropriate SycnMsgVersion based on RPC Spec version they are using. SyncMsgVersion received from the phone was never used by Core. There is a chance that apps have been sending incorrect versions based on the RPC Spec used in the mobile proxy.\r\n- SyncMsgVersion in RAI response will send negotiated version instead of Cores max version.\r\n\r\n##### Enhancements\r\n* Will allow the project to make breaking changes to RPCs without breaking support for legacy apps.\r\n\r\n### CLA\r\n- [x] I have signed [the CLA](https://docs.google.com/forms/d/e/1FAIpQLSdsgJY33VByaX482zHzi-xUm49JNnmuJOyAM6uegPQ2LXYVfA/viewform)","created_at":"2018-08-06T13:31:47Z","updated_at":"2018-08-06T14:09:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4f1c046c74212247132b071de9c3c3ddb68829d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497/commits","review_comments_url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497/comments","review_comment_url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/2497/comments","statuses_url":"https://api.github.com/repos/smartdevicelink/sdl_core/statuses/15ab4952f6825c6829aa0fada94d4a97422b2b12","head":{"label":"JackLivio:feature/mobile_versioning","ref":"feature/mobile_versioning","sha":"15ab4952f6825c6829aa0fada94d4a97422b2b12","user":{"login":"JackLivio","id":12038416,"node_id":"MDQ6VXNlcjEyMDM4NDE2","avatar_url":"https://avatars0.githubusercontent.com/u/12038416?v=4","gravatar_id":"","url":"https://api.github.com/users/JackLivio","html_url":"https://github.com/JackLivio","followers_url":"https://api.github.com/users/JackLivio/followers","following_url":"https://api.github.com/users/JackLivio/following{/other_user}","gists_url":"https://api.github.com/users/JackLivio/gists{/gist_id}","starred_url":"https://api.github.com/users/JackLivio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackLivio/subscriptions","organizations_url":"https://api.github.com/users/JackLivio/orgs","repos_url":"https://api.github.com/users/JackLivio/repos","events_url":"https://api.github.com/users/JackLivio/events{/privacy}","received_events_url":"https://api.github.com/users/JackLivio/received_events","type":"User","site_admin":false},"repo":{"id":34282639,"node_id":"MDEwOlJlcG9zaXRvcnkzNDI4MjYzOQ==","name":"sdl_core","full_name":"JackLivio/sdl_core","owner":{"login":"JackLivio","id":12038416,"node_id":"MDQ6VXNlcjEyMDM4NDE2","avatar_url":"https://avatars0.githubusercontent.com/u/12038416?v=4","gravatar_id":"","url":"https://api.github.com/users/JackLivio","html_url":"https://github.com/JackLivio","followers_url":"https://api.github.com/users/JackLivio/followers","following_url":"https://api.github.com/users/JackLivio/following{/other_user}","gists_url":"https://api.github.com/users/JackLivio/gists{/gist_id}","starred_url":"https://api.github.com/users/JackLivio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackLivio/subscriptions","organizations_url":"https://api.github.com/users/JackLivio/orgs","repos_url":"https://api.github.com/users/JackLivio/repos","events_url":"https://api.github.com/users/JackLivio/events{/privacy}","received_events_url":"https://api.github.com/users/JackLivio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JackLivio/sdl_core","description":"SmartDeviceLink Head Unit Emulator","fork":true,"url":"https://api.github.com/repos/JackLivio/sdl_core","forks_url":"https://api.github.com/repos/JackLivio/sdl_core/forks","keys_url":"https://api.github.com/repos/JackLivio/sdl_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JackLivio/sdl_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JackLivio/sdl_core/teams","hooks_url":"https://api.github.com/repos/JackLivio/sdl_core/hooks","issue_events_url":"https://api.github.com/repos/JackLivio/sdl_core/issues/events{/number}","events_url":"https://api.github.com/repos/JackLivio/sdl_core/events","assignees_url":"https://api.github.com/repos/JackLivio/sdl_core/assignees{/user}","branches_url":"https://api.github.com/repos/JackLivio/sdl_core/branches{/branch}","tags_url":"https://api.github.com/repos/JackLivio/sdl_core/tags","blobs_url":"https://api.github.com/repos/JackLivio/sdl_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JackLivio/sdl_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JackLivio/sdl_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/JackLivio/sdl_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JackLivio/sdl_core/statuses/{sha}","languages_url":"https://api.github.com/repos/JackLivio/sdl_core/languages","stargazers_url":"https://api.github.com/repos/JackLivio/sdl_core/stargazers","contributors_url":"https://api.github.com/repos/JackLivio/sdl_core/contributors","subscribers_url":"https://api.github.com/repos/JackLivio/sdl_core/subscribers","subscription_url":"https://api.github.com/repos/JackLivio/sdl_core/subscription","commits_url":"https://api.github.com/repos/JackLivio/sdl_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/JackLivio/sdl_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/JackLivio/sdl_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/JackLivio/sdl_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/JackLivio/sdl_core/contents/{+path}","compare_url":"https://api.github.com/repos/JackLivio/sdl_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JackLivio/sdl_core/merges","archive_url":"https://api.github.com/repos/JackLivio/sdl_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JackLivio/sdl_core/downloads","issues_url":"https://api.github.com/repos/JackLivio/sdl_core/issues{/number}","pulls_url":"https://api.github.com/repos/JackLivio/sdl_core/pulls{/number}","milestones_url":"https://api.github.com/repos/JackLivio/sdl_core/milestones{/number}","notifications_url":"https://api.github.com/repos/JackLivio/sdl_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JackLivio/sdl_core/labels{/name}","releases_url":"https://api.github.com/repos/JackLivio/sdl_core/releases{/id}","deployments_url":"https://api.github.com/repos/JackLivio/sdl_core/deployments","created_at":"2015-04-20T19:49:25Z","updated_at":"2017-07-13T19:03:30Z","pushed_at":"2018-08-06T13:35:07Z","git_url":"git://github.com/JackLivio/sdl_core.git","ssh_url":"git@github.com:JackLivio/sdl_core.git","clone_url":"https://github.com/JackLivio/sdl_core.git","svn_url":"https://github.com/JackLivio/sdl_core","homepage":"","size":308987,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"smartdevicelink:develop","ref":"develop","sha":"dde69f5ff6353b071586efba2c5746fffa296c83","user":{"login":"smartdevicelink","id":8671397,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2NzEzOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8671397?v=4","gravatar_id":"","url":"https://api.github.com/users/smartdevicelink","html_url":"https://github.com/smartdevicelink","followers_url":"https://api.github.com/users/smartdevicelink/followers","following_url":"https://api.github.com/users/smartdevicelink/following{/other_user}","gists_url":"https://api.github.com/users/smartdevicelink/gists{/gist_id}","starred_url":"https://api.github.com/users/smartdevicelink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartdevicelink/subscriptions","organizations_url":"https://api.github.com/users/smartdevicelink/orgs","repos_url":"https://api.github.com/users/smartdevicelink/repos","events_url":"https://api.github.com/users/smartdevicelink/events{/privacy}","received_events_url":"https://api.github.com/users/smartdevicelink/received_events","type":"Organization","site_admin":false},"repo":{"id":24724170,"node_id":"MDEwOlJlcG9zaXRvcnkyNDcyNDE3MA==","name":"sdl_core","full_name":"smartdevicelink/sdl_core","owner":{"login":"smartdevicelink","id":8671397,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2NzEzOTc=","avatar_url":"https://avatars3.githubusercontent.com/u/8671397?v=4","gravatar_id":"","url":"https://api.github.com/users/smartdevicelink","html_url":"https://github.com/smartdevicelink","followers_url":"https://api.github.com/users/smartdevicelink/followers","following_url":"https://api.github.com/users/smartdevicelink/following{/other_user}","gists_url":"https://api.github.com/users/smartdevicelink/gists{/gist_id}","starred_url":"https://api.github.com/users/smartdevicelink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartdevicelink/subscriptions","organizations_url":"https://api.github.com/users/smartdevicelink/orgs","repos_url":"https://api.github.com/users/smartdevicelink/repos","events_url":"https://api.github.com/users/smartdevicelink/events{/privacy}","received_events_url":"https://api.github.com/users/smartdevicelink/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smartdevicelink/sdl_core","description":"SmartDeviceLink In-Vehicle Software and Sample HMI","fork":false,"url":"https://api.github.com/repos/smartdevicelink/sdl_core","forks_url":"https://api.github.com/repos/smartdevicelink/sdl_core/forks","keys_url":"https://api.github.com/repos/smartdevicelink/sdl_core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smartdevicelink/sdl_core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smartdevicelink/sdl_core/teams","hooks_url":"https://api.github.com/repos/smartdevicelink/sdl_core/hooks","issue_events_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/events{/number}","events_url":"https://api.github.com/repos/smartdevicelink/sdl_core/events","assignees_url":"https://api.github.com/repos/smartdevicelink/sdl_core/assignees{/user}","branches_url":"https://api.github.com/repos/smartdevicelink/sdl_core/branches{/branch}","tags_url":"https://api.github.com/repos/smartdevicelink/sdl_core/tags","blobs_url":"https://api.github.com/repos/smartdevicelink/sdl_core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smartdevicelink/sdl_core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smartdevicelink/sdl_core/git/refs{/sha}","trees_url":"https://api.github.com/repos/smartdevicelink/sdl_core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smartdevicelink/sdl_core/statuses/{sha}","languages_url":"https://api.github.com/repos/smartdevicelink/sdl_core/languages","stargazers_url":"https://api.github.com/repos/smartdevicelink/sdl_core/stargazers","contributors_url":"https://api.github.com/repos/smartdevicelink/sdl_core/contributors","subscribers_url":"https://api.github.com/repos/smartdevicelink/sdl_core/subscribers","subscription_url":"https://api.github.com/repos/smartdevicelink/sdl_core/subscription","commits_url":"https://api.github.com/repos/smartdevicelink/sdl_core/commits{/sha}","git_commits_url":"https://api.github.com/repos/smartdevicelink/sdl_core/git/commits{/sha}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_core/comments{/number}","issue_comment_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/comments{/number}","contents_url":"https://api.github.com/repos/smartdevicelink/sdl_core/contents/{+path}","compare_url":"https://api.github.com/repos/smartdevicelink/sdl_core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smartdevicelink/sdl_core/merges","archive_url":"https://api.github.com/repos/smartdevicelink/sdl_core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smartdevicelink/sdl_core/downloads","issues_url":"https://api.github.com/repos/smartdevicelink/sdl_core/issues{/number}","pulls_url":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls{/number}","milestones_url":"https://api.github.com/repos/smartdevicelink/sdl_core/milestones{/number}","notifications_url":"https://api.github.com/repos/smartdevicelink/sdl_core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smartdevicelink/sdl_core/labels{/name}","releases_url":"https://api.github.com/repos/smartdevicelink/sdl_core/releases{/id}","deployments_url":"https://api.github.com/repos/smartdevicelink/sdl_core/deployments","created_at":"2014-10-02T15:16:26Z","updated_at":"2018-07-30T02:50:37Z","pushed_at":"2018-08-06T13:35:08Z","git_url":"git://github.com/smartdevicelink/sdl_core.git","ssh_url":"git@github.com:smartdevicelink/sdl_core.git","clone_url":"https://github.com/smartdevicelink/sdl_core.git","svn_url":"https://github.com/smartdevicelink/sdl_core","homepage":"","size":318583,"stargazers_count":151,"watchers_count":151,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"archived":false,"open_issues_count":441,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":201,"open_issues":441,"watchers":151,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497"},"html":{"href":"https://github.com/smartdevicelink/sdl_core/pull/2497"},"issue":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/2497"},"comments":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/issues/2497/comments"},"review_comments":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497/comments"},"review_comment":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/pulls/2497/commits"},"statuses":{"href":"https://api.github.com/repos/smartdevicelink/sdl_core/statuses/15ab4952f6825c6829aa0fada94d4a97422b2b12"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"LuxoftAKutsan"}}