mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 02:18:44 +00:00
Special case JSON _links property.
For some reason, the List Feeds http://developer.github.com/v3/activity/feeds/#list-feeds API response has a field that starts with an underscore. This also occurs in the Review Comments API: http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository and in the Contents API. http://developer.github.com/v3/repos/contents/#get-the-readme This commit special cases that one field so we can use the expected CLR property name. I couldn't find a case where a JSON response doesn't prefix "links" with an underscore. Related to #386
This commit is contained in:
@@ -23,7 +23,9 @@ namespace Octokit.Internal
|
||||
{
|
||||
protected override string MapClrMemberNameToJsonFieldName(string clrPropertyName)
|
||||
{
|
||||
return clrPropertyName.ToRubyCase();
|
||||
var rubyCased = clrPropertyName.ToRubyCase();
|
||||
if (rubyCased == "links") return "_links"; // Special case for GitHub API
|
||||
return rubyCased;
|
||||
}
|
||||
|
||||
// This is overridden so that null values are omitted from serialized objects.
|
||||
|
||||
Reference in New Issue
Block a user