{"action":"created","issue":{"url":"https://api.github.com/repos/Julian/jsonschema/issues/481","repository_url":"https://api.github.com/repos/Julian/jsonschema","labels_url":"https://api.github.com/repos/Julian/jsonschema/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/Julian/jsonschema/issues/481/comments","events_url":"https://api.github.com/repos/Julian/jsonschema/issues/481/events","html_url":"https://github.com/Julian/jsonschema/issues/481","id":373393174,"node_id":"MDU6SXNzdWUzNzMzOTMxNzQ=","number":481,"title":"Keep object key order when resolving a schema","user":{"login":"marmeladema","id":1629419,"node_id":"MDQ6VXNlcjE2Mjk0MTk=","avatar_url":"https://avatars2.githubusercontent.com/u/1629419?v=4","gravatar_id":"","url":"https://api.github.com/users/marmeladema","html_url":"https://github.com/marmeladema","followers_url":"https://api.github.com/users/marmeladema/followers","following_url":"https://api.github.com/users/marmeladema/following{/other_user}","gists_url":"https://api.github.com/users/marmeladema/gists{/gist_id}","starred_url":"https://api.github.com/users/marmeladema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmeladema/subscriptions","organizations_url":"https://api.github.com/users/marmeladema/orgs","repos_url":"https://api.github.com/users/marmeladema/repos","events_url":"https://api.github.com/users/marmeladema/events{/privacy}","received_events_url":"https://api.github.com/users/marmeladema/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-10-24T09:39:20Z","updated_at":"2018-11-13T18:37:22Z","closed_at":null,"author_association":"NONE","body":"As explained in the title, when resolving a schema on Python version (< 3.6) where dict implementation does not keep key insertion ordering, the object key order can be lost. This can be especially problematic for the \"properties\" object that is usually found in schemas.\r\n\r\nI would be glad to provide a PR to fix this. My approach would be to provide a json_kwargs as RefResolver.__init__ argument and forward it to json.loads in resolve_remote, so that users that need this functionality (at least me) could pass the object_pairs_hook argument with an OrderedDict value.\r\n\r\nWould you be ok with that ?"},"comment":{"url":"https://api.github.com/repos/Julian/jsonschema/issues/comments/438386971","html_url":"https://github.com/Julian/jsonschema/issues/481#issuecomment-438386971","issue_url":"https://api.github.com/repos/Julian/jsonschema/issues/481","id":438386971,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODM4Njk3MQ==","user":{"login":"Julian","id":329822,"node_id":"MDQ6VXNlcjMyOTgyMg==","avatar_url":"https://avatars1.githubusercontent.com/u/329822?v=4","gravatar_id":"","url":"https://api.github.com/users/Julian","html_url":"https://github.com/Julian","followers_url":"https://api.github.com/users/Julian/followers","following_url":"https://api.github.com/users/Julian/following{/other_user}","gists_url":"https://api.github.com/users/Julian/gists{/gist_id}","starred_url":"https://api.github.com/users/Julian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Julian/subscriptions","organizations_url":"https://api.github.com/users/Julian/orgs","repos_url":"https://api.github.com/users/Julian/repos","events_url":"https://api.github.com/users/Julian/events{/privacy}","received_events_url":"https://api.github.com/users/Julian/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T18:37:21Z","updated_at":"2018-11-13T18:37:21Z","author_association":"OWNER","body":"> (Also, if there's a reason not use do this, I'd like to know)\r\n> This seems to work fine, although if the API settles down, I would just inherit from RefResolver and override resolve_remote to avoid weird fall-through cases.\r\n\r\nSubclassing isn't a supported public API for any classes in jsonschema :), but otherwise this looks reasonable.\r\n\r\n> For the broader discussion, being able to mess around with RefResolver would be super useful because it does a lot, but I can understand the reluctance of having to support old designs.\r\n\r\nDefinitely keen to hear if you have any use cases that wouldn't be solved by what's in #420!"}}
{"actor":{"display_login":"Julian"}}