Fix trailing whitespace, fix case handling

This commit is contained in:
Konstantin Safonov 2021-01-17 05:12:33 +03:00
parent c42b0f7626
commit 83980e6c77

View File

@ -76,10 +76,10 @@ namespace EpicMorg.Atlassian.Downloader
private async Task<(string json, IDictionary<string, ResponseItem[]> versions)> GetJson(string feedUrl, CancellationToken cancellationToken)
{
var atlassianJson = await client.GetStringAsync(feedUrl, cancellationToken).ConfigureAwait(false);
var json = atlassianJson["downloads(".Length..^1];
var json = atlassianJson.Trim()["downloads(".Length..^1];
var parsed = JsonSerializer.Deserialize<ResponseItem[]>(json, new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
PropertyNameCaseInsensitive = true
});
var versions = parsed.GroupBy(a => a.Version).ToDictionary(a => a.Key, a => a.ToArray());