mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-02 19:00:47 +00:00
Merge pull request #815 from campersau/patch-1
rename misleading responseIsArray variable to responseIsObject
This commit is contained in:
@@ -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 + "]";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user