Merge pull request #815 from campersau/patch-1

rename misleading responseIsArray variable to responseIsObject
This commit is contained in:
Phil Haack
2015-06-11 19:27:04 -07:00
+2 -2
View File
@@ -54,11 +54,11 @@ namespace Octokit.Internal
{
var typeIsDictionary = typeof(IDictionary).IsAssignableFrom(typeof(T));
var typeIsEnumerable = typeof(IEnumerable).IsAssignableFrom(typeof(T));
var responseIsArray = body.StartsWith("{", StringComparison.Ordinal);
var responseIsObject = body.StartsWith("{", StringComparison.Ordinal);
// If we're expecting an array, but we get a single object, just wrap it.
// This supports an api that dynamically changes the return type based on the content.
if (!typeIsDictionary && typeIsEnumerable && responseIsArray)
if (!typeIsDictionary && typeIsEnumerable && responseIsObject)
{
body = "[" + body + "]";
}