Cytraen / BungieSharper

A .NET client library for the Bungie.net API.
MIT License
15 stars 1 forks source link

Manifest data not populating AggregateDestinyDefinitions #38

Closed dano1066 closed 2 years ago

dano1066 commented 2 years ago

Using the following block of code, definitionList does not contain any data. The object is created but with a collection of null properties.

var manafest = client.Api.Destiny2_GetDestinyManifest().Result;
var definitionListJson = new WebClient().DownloadString($"https://www.bungie.net/{manafest.JsonWorldContentPaths["en"]}");
var definitionList = JsonConvert.DeserializeObject<AggregateDestinyDefinitions>(definitionListJson);
Cytraen commented 2 years ago

Your usage of JsonConvert implies usage of Newtonsoft.Json. BungieSharper uses System.Text.Json and does not use the naming attributes that Newtonsoft looks for.

Some other notes:

  1. WebClient() is obsolete in .NET 6
  2. BungieSharper's client includes "download as string" already.