{"action":"created","issue":{"url":"https://api.github.com/repos/json-c/json-c/issues/142","repository_url":"https://api.github.com/repos/json-c/json-c","labels_url":"https://api.github.com/repos/json-c/json-c/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/json-c/json-c/issues/142/comments","events_url":"https://api.github.com/repos/json-c/json-c/issues/142/events","html_url":"https://github.com/json-c/json-c/issues/142","id":38075354,"number":142,"title":"Please undeprecate json_object_object_get","user":{"login":"fclairamb","id":1743394,"avatar_url":"https://avatars3.githubusercontent.com/u/1743394?v=3","gravatar_id":"","url":"https://api.github.com/users/fclairamb","html_url":"https://github.com/fclairamb","followers_url":"https://api.github.com/users/fclairamb/followers","following_url":"https://api.github.com/users/fclairamb/following{/other_user}","gists_url":"https://api.github.com/users/fclairamb/gists{/gist_id}","starred_url":"https://api.github.com/users/fclairamb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fclairamb/subscriptions","organizations_url":"https://api.github.com/users/fclairamb/orgs","repos_url":"https://api.github.com/users/fclairamb/repos","events_url":"https://api.github.com/users/fclairamb/events{/privacy}","received_events_url":"https://api.github.com/users/fclairamb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2014-07-17T12:17:47Z","updated_at":"2017-06-30T08:10:36Z","closed_at":"2016-05-23T03:03:20Z","body":"One of the great advantages of using json-c is to have very little code to write. Now with this json_object_object_get deprecation, we have to change:\r\n\r\n```\r\nint timeout = json_object_get_int(json_object_object_get(request, \"timeout\"));\r\n```\r\n\r\nto this:\r\n\r\n```\r\nint timeout;\r\n{\r\n    json_object * jTimeout;\r\n    if ( json_object_object_get_ex(request, \"timeout\", & jTimeout) ) {\r\n        timeout = json_object_get_int(jTimeout);\r\n    } else {\r\n        timeout = 0\r\n    }\r\n}\r\n```\r\n\r\nsame thing for strings. We cannot do:\r\n\r\n```\r\nconst char * name = json_object_get_string( json_object_object_get(request, \"name\"));\r\n```\r\n\r\nSure, it relies on the fact that the API is nice enough to accept NULL object to the `json_object_get_int` and `json_object_get_string` functions.\r\n\r\nAnd sure we can make our own wrapper:\r\n\r\n```\r\njson_object * json_object_object_get_old(json_object * obj, const char * name) {\r\n    json_object * sub;\r\n    return json_object_object_get_ex(obj, name, & sub) ? sub : NULL;\r\n}\r\n```\r\n\r\nBut I don't understand why you decided to remove something in the API that forces us to write more code.\r\n"},"comment":{"url":"https://api.github.com/repos/json-c/json-c/issues/comments/312204456","html_url":"https://github.com/json-c/json-c/issues/142#issuecomment-312204456","issue_url":"https://api.github.com/repos/json-c/json-c/issues/142","id":312204456,"user":{"login":"IronFox","id":2706435,"avatar_url":"https://avatars2.githubusercontent.com/u/2706435?v=3","gravatar_id":"","url":"https://api.github.com/users/IronFox","html_url":"https://github.com/IronFox","followers_url":"https://api.github.com/users/IronFox/followers","following_url":"https://api.github.com/users/IronFox/following{/other_user}","gists_url":"https://api.github.com/users/IronFox/gists{/gist_id}","starred_url":"https://api.github.com/users/IronFox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IronFox/subscriptions","organizations_url":"https://api.github.com/users/IronFox/orgs","repos_url":"https://api.github.com/users/IronFox/repos","events_url":"https://api.github.com/users/IronFox/events{/privacy}","received_events_url":"https://api.github.com/users/IronFox/received_events","type":"User","site_admin":false},"created_at":"2017-06-30T08:10:36Z","updated_at":"2017-06-30T08:10:36Z","body":"Looks like '@deprecated Please use json_object_object_get_ex' was left in the doxygen documentation. Seems harmless though, just use the function. It won't disappear"}}
{"actor":{"display_login":"IronFox"}}