{"action":"created","comment":{"url":"https://api.github.com/repos/inveniosoftware/doschema/pulls/comments/56981484","id":56981484,"diff_hunk":"@@ -0,0 +1,138 @@\n+# -*- coding: utf-8 -*-\n+#\n+# This file is part of DoSchema.\n+# Copyright (C) 2016 CERN.\n+#\n+# DoSchema is free software; you can redistribute it\n+# and/or modify it under the terms of the GNU General Public License as\n+# published by the Free Software Foundation; either version 2 of the\n+# License, or (at your option) any later version.\n+#\n+# DoSchema is distributed in the hope that it will be\n+# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with DoSchema; if not, write to the\n+# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,\n+# MA 02111-1307, USA.\n+#\n+# In applying this license, CERN does not\n+# waive the privileges and immunities granted to it by virtue of its status\n+# as an Intergovernmental Organization or submit itself to any jurisdiction.\n+\n+\"\"\"Merger module.\"\"\"\n+\n+import collections\n+\n+from doschema.errors import JSONSchemaCompatibilityException\n+\n+\n+class JSONSchemaValidation(object):\n+    \"\"\"Class for checking compatibility between schemas.\"\"\"\n+\n+    def __init__(self, ignore_index=True):\n+        \"\"\"Constructor.\n+\n+        :param ignore_index: If set to True, which is default, it will ignore\n+                             array indexes.\n+        \"\"\"\n+        self.ignore_index = ignore_index\n+        self.fields_types_dict = {}\n+\n+    def start(self, schema, schema_name):\n+        \"\"\"Start processing a given list of schemas.\n+\n+        :param schema: Name of schema that is currently processed.\n+        :param schema_name: Name of schema that is currently processed.\n+        \"\"\"\n+        self.traverse(schema, (), schema_name)","path":"doschema/jsvalidation.py","position":50,"original_position":50,"commit_id":"4157c0770b53b5021f985e29fee42bb1e975da0f","original_commit_id":"4157c0770b53b5021f985e29fee42bb1e975da0f","user":{"login":"nharraud","id":5708796,"avatar_url":"https://avatars.githubusercontent.com/u/5708796?v=3","gravatar_id":"","url":"https://api.github.com/users/nharraud","html_url":"https://github.com/nharraud","followers_url":"https://api.github.com/users/nharraud/followers","following_url":"https://api.github.com/users/nharraud/following{/other_user}","gists_url":"https://api.github.com/users/nharraud/gists{/gist_id}","starred_url":"https://api.github.com/users/nharraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nharraud/subscriptions","organizations_url":"https://api.github.com/users/nharraud/orgs","repos_url":"https://api.github.com/users/nharraud/repos","events_url":"https://api.github.com/users/nharraud/events{/privacy}","received_events_url":"https://api.github.com/users/nharraud/received_events","type":"User","site_admin":false},"body":"the `schema_name` does not change during the validation. There is no need to give it to every method. You can directly set it to a class attribute and set it to 'None' once the validation is done (remember to reset it also when an exception is raised).","created_at":"2016-03-22T13:02:47Z","updated_at":"2016-03-22T13:02:47Z","html_url":"https://github.com/inveniosoftware/doschema/pull/3#discussion_r56981484","pull_request_url":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/doschema/pulls/comments/56981484"},"html":{"href":"https://github.com/inveniosoftware/doschema/pull/3#discussion_r56981484"},"pull_request":{"href":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3","id":62764392,"html_url":"https://github.com/inveniosoftware/doschema/pull/3","diff_url":"https://github.com/inveniosoftware/doschema/pull/3.diff","patch_url":"https://github.com/inveniosoftware/doschema/pull/3.patch","issue_url":"https://api.github.com/repos/inveniosoftware/doschema/issues/3","number":3,"state":"open","locked":false,"title":"WIP global: new schemas compatibility function","user":{"login":"Paulina1","id":1929323,"avatar_url":"https://avatars.githubusercontent.com/u/1929323?v=3","gravatar_id":"","url":"https://api.github.com/users/Paulina1","html_url":"https://github.com/Paulina1","followers_url":"https://api.github.com/users/Paulina1/followers","following_url":"https://api.github.com/users/Paulina1/following{/other_user}","gists_url":"https://api.github.com/users/Paulina1/gists{/gist_id}","starred_url":"https://api.github.com/users/Paulina1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paulina1/subscriptions","organizations_url":"https://api.github.com/users/Paulina1/orgs","repos_url":"https://api.github.com/users/Paulina1/repos","events_url":"https://api.github.com/users/Paulina1/events{/privacy}","received_events_url":"https://api.github.com/users/Paulina1/received_events","type":"User","site_admin":false},"body":"* NEW Adds a function which checks the backward compatibility\r\n  of JSON Schemas.\r\n\r\nSigned-off-by: Paulina1 <paulina.malgorzata.lach@cern.cech>","created_at":"2016-03-14T15:18:22Z","updated_at":"2016-03-22T13:02:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e4b0f0d721d4d1e83c1cc814e17458111413a692","assignee":{"login":"Paulina1","id":1929323,"avatar_url":"https://avatars.githubusercontent.com/u/1929323?v=3","gravatar_id":"","url":"https://api.github.com/users/Paulina1","html_url":"https://github.com/Paulina1","followers_url":"https://api.github.com/users/Paulina1/followers","following_url":"https://api.github.com/users/Paulina1/following{/other_user}","gists_url":"https://api.github.com/users/Paulina1/gists{/gist_id}","starred_url":"https://api.github.com/users/Paulina1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paulina1/subscriptions","organizations_url":"https://api.github.com/users/Paulina1/orgs","repos_url":"https://api.github.com/users/Paulina1/repos","events_url":"https://api.github.com/users/Paulina1/events{/privacy}","received_events_url":"https://api.github.com/users/Paulina1/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inveniosoftware/doschema/milestones/1","html_url":"https://github.com/inveniosoftware/doschema/milestones/v0.1.0","labels_url":"https://api.github.com/repos/inveniosoftware/doschema/milestones/1/labels","id":1628488,"number":1,"title":"v0.1.0","description":null,"creator":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2016-03-08T10:12:59Z","updated_at":"2016-03-16T13:11:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3/commits","review_comments_url":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3/comments","review_comment_url":"https://api.github.com/repos/inveniosoftware/doschema/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inveniosoftware/doschema/issues/3/comments","statuses_url":"https://api.github.com/repos/inveniosoftware/doschema/statuses/4157c0770b53b5021f985e29fee42bb1e975da0f","head":{"label":"Paulina1:doschemaMine","ref":"doschemaMine","sha":"4157c0770b53b5021f985e29fee42bb1e975da0f","user":{"login":"Paulina1","id":1929323,"avatar_url":"https://avatars.githubusercontent.com/u/1929323?v=3","gravatar_id":"","url":"https://api.github.com/users/Paulina1","html_url":"https://github.com/Paulina1","followers_url":"https://api.github.com/users/Paulina1/followers","following_url":"https://api.github.com/users/Paulina1/following{/other_user}","gists_url":"https://api.github.com/users/Paulina1/gists{/gist_id}","starred_url":"https://api.github.com/users/Paulina1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paulina1/subscriptions","organizations_url":"https://api.github.com/users/Paulina1/orgs","repos_url":"https://api.github.com/users/Paulina1/repos","events_url":"https://api.github.com/users/Paulina1/events{/privacy}","received_events_url":"https://api.github.com/users/Paulina1/received_events","type":"User","site_admin":false},"repo":{"id":53479901,"name":"doschema","full_name":"Paulina1/doschema","owner":{"login":"Paulina1","id":1929323,"avatar_url":"https://avatars.githubusercontent.com/u/1929323?v=3","gravatar_id":"","url":"https://api.github.com/users/Paulina1","html_url":"https://github.com/Paulina1","followers_url":"https://api.github.com/users/Paulina1/followers","following_url":"https://api.github.com/users/Paulina1/following{/other_user}","gists_url":"https://api.github.com/users/Paulina1/gists{/gist_id}","starred_url":"https://api.github.com/users/Paulina1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paulina1/subscriptions","organizations_url":"https://api.github.com/users/Paulina1/orgs","repos_url":"https://api.github.com/users/Paulina1/repos","events_url":"https://api.github.com/users/Paulina1/events{/privacy}","received_events_url":"https://api.github.com/users/Paulina1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Paulina1/doschema","description":"Utilities to work with JSON Schemas.","fork":true,"url":"https://api.github.com/repos/Paulina1/doschema","forks_url":"https://api.github.com/repos/Paulina1/doschema/forks","keys_url":"https://api.github.com/repos/Paulina1/doschema/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Paulina1/doschema/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Paulina1/doschema/teams","hooks_url":"https://api.github.com/repos/Paulina1/doschema/hooks","issue_events_url":"https://api.github.com/repos/Paulina1/doschema/issues/events{/number}","events_url":"https://api.github.com/repos/Paulina1/doschema/events","assignees_url":"https://api.github.com/repos/Paulina1/doschema/assignees{/user}","branches_url":"https://api.github.com/repos/Paulina1/doschema/branches{/branch}","tags_url":"https://api.github.com/repos/Paulina1/doschema/tags","blobs_url":"https://api.github.com/repos/Paulina1/doschema/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Paulina1/doschema/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Paulina1/doschema/git/refs{/sha}","trees_url":"https://api.github.com/repos/Paulina1/doschema/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Paulina1/doschema/statuses/{sha}","languages_url":"https://api.github.com/repos/Paulina1/doschema/languages","stargazers_url":"https://api.github.com/repos/Paulina1/doschema/stargazers","contributors_url":"https://api.github.com/repos/Paulina1/doschema/contributors","subscribers_url":"https://api.github.com/repos/Paulina1/doschema/subscribers","subscription_url":"https://api.github.com/repos/Paulina1/doschema/subscription","commits_url":"https://api.github.com/repos/Paulina1/doschema/commits{/sha}","git_commits_url":"https://api.github.com/repos/Paulina1/doschema/git/commits{/sha}","comments_url":"https://api.github.com/repos/Paulina1/doschema/comments{/number}","issue_comment_url":"https://api.github.com/repos/Paulina1/doschema/issues/comments{/number}","contents_url":"https://api.github.com/repos/Paulina1/doschema/contents/{+path}","compare_url":"https://api.github.com/repos/Paulina1/doschema/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Paulina1/doschema/merges","archive_url":"https://api.github.com/repos/Paulina1/doschema/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Paulina1/doschema/downloads","issues_url":"https://api.github.com/repos/Paulina1/doschema/issues{/number}","pulls_url":"https://api.github.com/repos/Paulina1/doschema/pulls{/number}","milestones_url":"https://api.github.com/repos/Paulina1/doschema/milestones{/number}","notifications_url":"https://api.github.com/repos/Paulina1/doschema/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Paulina1/doschema/labels{/name}","releases_url":"https://api.github.com/repos/Paulina1/doschema/releases{/id}","deployments_url":"https://api.github.com/repos/Paulina1/doschema/deployments","created_at":"2016-03-09T08:11:46Z","updated_at":"2016-03-09T08:11:47Z","pushed_at":"2016-03-22T12:50:29Z","git_url":"git://github.com/Paulina1/doschema.git","ssh_url":"git@github.com:Paulina1/doschema.git","clone_url":"https://github.com/Paulina1/doschema.git","svn_url":"https://github.com/Paulina1/doschema","homepage":null,"size":42,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"inveniosoftware:master","ref":"master","sha":"3d606f2d5791756a3eb8408fada31bf6b949f9e7","user":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":53312610,"name":"doschema","full_name":"inveniosoftware/doschema","owner":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inveniosoftware/doschema","description":"Utilities to work with JSON Schemas.","fork":false,"url":"https://api.github.com/repos/inveniosoftware/doschema","forks_url":"https://api.github.com/repos/inveniosoftware/doschema/forks","keys_url":"https://api.github.com/repos/inveniosoftware/doschema/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inveniosoftware/doschema/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inveniosoftware/doschema/teams","hooks_url":"https://api.github.com/repos/inveniosoftware/doschema/hooks","issue_events_url":"https://api.github.com/repos/inveniosoftware/doschema/issues/events{/number}","events_url":"https://api.github.com/repos/inveniosoftware/doschema/events","assignees_url":"https://api.github.com/repos/inveniosoftware/doschema/assignees{/user}","branches_url":"https://api.github.com/repos/inveniosoftware/doschema/branches{/branch}","tags_url":"https://api.github.com/repos/inveniosoftware/doschema/tags","blobs_url":"https://api.github.com/repos/inveniosoftware/doschema/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inveniosoftware/doschema/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inveniosoftware/doschema/git/refs{/sha}","trees_url":"https://api.github.com/repos/inveniosoftware/doschema/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inveniosoftware/doschema/statuses/{sha}","languages_url":"https://api.github.com/repos/inveniosoftware/doschema/languages","stargazers_url":"https://api.github.com/repos/inveniosoftware/doschema/stargazers","contributors_url":"https://api.github.com/repos/inveniosoftware/doschema/contributors","subscribers_url":"https://api.github.com/repos/inveniosoftware/doschema/subscribers","subscription_url":"https://api.github.com/repos/inveniosoftware/doschema/subscription","commits_url":"https://api.github.com/repos/inveniosoftware/doschema/commits{/sha}","git_commits_url":"https://api.github.com/repos/inveniosoftware/doschema/git/commits{/sha}","comments_url":"https://api.github.com/repos/inveniosoftware/doschema/comments{/number}","issue_comment_url":"https://api.github.com/repos/inveniosoftware/doschema/issues/comments{/number}","contents_url":"https://api.github.com/repos/inveniosoftware/doschema/contents/{+path}","compare_url":"https://api.github.com/repos/inveniosoftware/doschema/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inveniosoftware/doschema/merges","archive_url":"https://api.github.com/repos/inveniosoftware/doschema/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inveniosoftware/doschema/downloads","issues_url":"https://api.github.com/repos/inveniosoftware/doschema/issues{/number}","pulls_url":"https://api.github.com/repos/inveniosoftware/doschema/pulls{/number}","milestones_url":"https://api.github.com/repos/inveniosoftware/doschema/milestones{/number}","notifications_url":"https://api.github.com/repos/inveniosoftware/doschema/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inveniosoftware/doschema/labels{/name}","releases_url":"https://api.github.com/repos/inveniosoftware/doschema/releases{/id}","deployments_url":"https://api.github.com/repos/inveniosoftware/doschema/deployments","created_at":"2016-03-07T09:26:28Z","updated_at":"2016-03-08T10:40:38Z","pushed_at":"2016-03-22T12:50:29Z","git_url":"git://github.com/inveniosoftware/doschema.git","ssh_url":"git@github.com:inveniosoftware/doschema.git","clone_url":"https://github.com/inveniosoftware/doschema.git","svn_url":"https://github.com/inveniosoftware/doschema","homepage":null,"size":24,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3"},"html":{"href":"https://github.com/inveniosoftware/doschema/pull/3"},"issue":{"href":"https://api.github.com/repos/inveniosoftware/doschema/issues/3"},"comments":{"href":"https://api.github.com/repos/inveniosoftware/doschema/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/inveniosoftware/doschema/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inveniosoftware/doschema/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/inveniosoftware/doschema/statuses/4157c0770b53b5021f985e29fee42bb1e975da0f"}}}}