{"push_id":1396647891,"size":2,"distinct_size":1,"ref":"refs/heads/master","head":"8f5feed2a8103f3646a8b398ef315b41e5ac83fd","before":"4bc339f6fe84afbb23413996d17ff0e9314ea7d8","commits":[{"sha":"354868523a62cff0236fbaf15ddf2ed2ec2b24c9","author":{"name":"Jason Tu","email":"4489d6cba937235792b2dd8ca367548f22e4270d@gmail.com"},"message":"Add a callback for object ID labels.","distinct":false,"url":"https://api.github.com/repos/RisingTideGames/jsoneditor/commits/354868523a62cff0236fbaf15ddf2ed2ec2b24c9"},{"sha":"8f5feed2a8103f3646a8b398ef315b41e5ac83fd","author":{"name":"Jason Tu","email":"4489d6cba937235792b2dd8ca367548f22e4270d@gmail.com"},"message":"feat(*): Add a callback for object ID labels\n\nThis is useful when you want your object nodes to show more context. Example:\r\n\r\n```js\r\nconst json = {\r\n  \"campaignList\": [\r\n    {\r\n      \"name\": \"Halloween Promotion\",\r\n      \"foo\": \"bar\",\r\n      \"baz\": \"quz\"\r\n    }\r\n  ]\r\n}\r\n\r\nconst options = {\r\n  onObjectID(jsonPath) {\r\n    if (jsonPath[0] === 'campaignList' && typeof jsonPath[1] === 'number') {\r\n      return 'name'\r\n    }\r\n  }\r\n}\r\n\r\nconst editor = new JSONEditor(element, options, json)\r\n```\r\n\r\nAs you can see, `onObjectID` expects the JSON path as input, and returns the name of the ID key within the object. In the browser, the value of the ID key is then displayed next to the object node. For the example above, the value would be `\"Halloween Promotion\"`.\r\n\r\nThis is a temporary hack intended for use within internal tools at Rising Tide Games (a game studio under Zynga). The JSON editor rewrite mentioned in josdejong/jsoneditor#337 may make this hack unnecessary.","distinct":true,"url":"https://api.github.com/repos/RisingTideGames/jsoneditor/commits/8f5feed2a8103f3646a8b398ef315b41e5ac83fd"}]}
{"actor":{"display_login":"nucleartide"}}