8
8
using System . Text . RegularExpressions ;
9
9
using System . Threading . Tasks ;
10
10
using GitCredentialManager ;
11
- using Newtonsoft . Json ;
11
+ using System . Text . Json ;
12
+ using System . Text . Json . Serialization ;
12
13
13
14
namespace GitHub
14
15
{
@@ -105,7 +106,7 @@ public async Task<GitHubUserInfo> GetUserInfoAsync(Uri targetUri, string accessT
105
106
106
107
string json = await response . Content . ReadAsStringAsync ( ) ;
107
108
108
- return JsonConvert . DeserializeObject < GitHubUserInfo > ( json ) ;
109
+ return JsonSerializer . Deserialize < GitHubUserInfo > ( json ) ;
109
110
}
110
111
}
111
112
}
@@ -124,7 +125,7 @@ public async Task<GitHubMetaInfo> GetMetaInfoAsync(Uri targetUri)
124
125
125
126
string json = await response . Content . ReadAsStringAsync ( ) ;
126
127
127
- return JsonConvert . DeserializeObject < GitHubMetaInfo > ( json ) ;
128
+ return JsonSerializer . Deserialize < GitHubMetaInfo > ( json ) ;
128
129
}
129
130
}
130
131
@@ -265,16 +266,16 @@ public void Dispose()
265
266
266
267
public class GitHubUserInfo
267
268
{
268
- [ JsonProperty ( "login" ) ]
269
+ [ JsonPropertyName ( "login" ) ]
269
270
public string Login { get ; set ; }
270
271
}
271
272
272
273
public class GitHubMetaInfo
273
274
{
274
- [ JsonProperty ( "installed_version" ) ]
275
+ [ JsonPropertyName ( "installed_version" ) ]
275
276
public string InstalledVersion { get ; set ; }
276
277
277
- [ JsonProperty ( "verifiable_password_authentication" ) ]
278
+ [ JsonPropertyName ( "verifiable_password_authentication" ) ]
278
279
public bool VerifiablePasswordAuthentication { get ; set ; }
279
280
}
280
281
0 commit comments