Archomeda / Gw2Sharp

A cross-platform .NET wrapper library for the Guild Wars 2 API written in C#
https://archomeda.github.io/Gw2Sharp
MIT License
37 stars 8 forks source link

Allow less strict type casting when a type doesn't exist #120

Closed Archomeda closed 1 year ago

Archomeda commented 2 years ago

Currently when a CastableType doesn't exist, Gw2Sharp throws an exception like System.Text.Json.JsonException: Unsupported type Quux. This is unhelpful when new content gets added, because this requires an update of Gw2Sharp before stuff works again.

This checking should be less strict. If a type doesn't exist, the base class should be used instead. There should be an option to enable strict type casting (useful for testing), but the default should be set to false.

Ref #117