mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Merge branch 'master' into redirect-requests
Conflicts: Octokit/Octokit-Mono.csproj Octokit/Octokit-MonoAndroid.csproj Octokit/Octokit-Monotouch.csproj Octokit/Octokit-Portable.csproj Octokit/Octokit-netcore45.csproj
This commit is contained in:
@@ -53,11 +53,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