Cytraen / BungieSharper

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

Potential solution for creating custom API requests #35

Closed Taybenberg closed 2 years ago

Taybenberg commented 2 years ago

Can be used to return derived types from DestinyDefinition by creating custom GetDestinyEntityDefinition request. ex: apiClient.DownloadType<DestinyActivityDefinition>($"Destiny2/Manifest/DestinyActivityDefinition/1681562271");

Cytraen commented 2 years ago

The problem is not with the request itself, it's that there is no reliable way to tell what type derives from what, and which endpoint would need a type parameter. I'm planning on either adding a way to let users specify a type to de-serialize to or letting them handle the de-serialization on their own and only returning the HTTP response.

EDIT: Newest commit allows specifying return types, you can download the build artifact and see if that works for your purposes