mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-21 06:35:11 +00:00
we should deserialize Urls in a specific way
This commit is contained in:
@@ -64,6 +64,15 @@ namespace Octokit.Internal
|
||||
var stringValue = value as string;
|
||||
if (stringValue != null)
|
||||
{
|
||||
if (ReflectionUtils.IsUri(type))
|
||||
{
|
||||
Uri result;
|
||||
if (Uri.TryCreate(stringValue, UriKind.RelativeOrAbsolute, out result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if (ReflectionUtils.GetTypeInfo(type).IsEnum)
|
||||
{
|
||||
return Enum.Parse(type, stringValue, ignoreCase: true);
|
||||
|
||||
Reference in New Issue
Block a user