{"action":"opened","issue":{"url":"https://api.github.com/repos/gregsdennis/Manatee.Json/issues/40","repository_url":"https://api.github.com/repos/gregsdennis/Manatee.Json","labels_url":"https://api.github.com/repos/gregsdennis/Manatee.Json/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/gregsdennis/Manatee.Json/issues/40/comments","events_url":"https://api.github.com/repos/gregsdennis/Manatee.Json/issues/40/events","html_url":"https://github.com/gregsdennis/Manatee.Json/issues/40","id":179115189,"number":40,"title":"Path to value serialization attribute","user":{"login":"gregsdennis","id":2676804,"avatar_url":"https://avatars.githubusercontent.com/u/2676804?v=3","gravatar_id":"","url":"https://api.github.com/users/gregsdennis","html_url":"https://github.com/gregsdennis","followers_url":"https://api.github.com/users/gregsdennis/followers","following_url":"https://api.github.com/users/gregsdennis/following{/other_user}","gists_url":"https://api.github.com/users/gregsdennis/gists{/gist_id}","starred_url":"https://api.github.com/users/gregsdennis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregsdennis/subscriptions","organizations_url":"https://api.github.com/users/gregsdennis/orgs","repos_url":"https://api.github.com/users/gregsdennis/repos","events_url":"https://api.github.com/users/gregsdennis/events{/privacy}","received_events_url":"https://api.github.com/users/gregsdennis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-25T23:15:46Z","updated_at":"2016-09-25T23:15:46Z","closed_at":null,"body":"This would be a property/field attribute that contains a JsonPath (probably as a string since only compile-time constants can be used in attributes) to the value in the data structure.\r\n\r\nFor instance, the given the object\r\n\r\n```json\r\n    {\"first\":\"Greg\",\"last\":\"Dennis\",\"other data\":{\"location\":\"NZ\"}}\r\n```\r\n\r\nyou could model with the following attributed class\r\n\r\n```csharp\r\n    class Person\r\n    {\r\n        [Path(\"$.first\")]\r\n        public string First { get; set; }\r\n        [Path(\"$.last\")]\r\n        public string Last { get; set; }\r\n        [Path(\"$.'other data'.location\")]\r\n        public string Location { get; set; }\r\n    }\r\n```\r\n\r\nThe catch is that the path returns an array of values.  There will likely have to be configuration around behavior when multiple values are returned (throw, take first, etc.)."}}
{"actor":{"display_login":"gregsdennis"}}