diff options
| author | crobibero <cody@robibe.ro> | 2020-09-01 09:19:22 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-01 09:19:22 -0600 |
| commit | eb400f72928c9a87362c7d763be4627a7f9cd5cb (patch) | |
| tree | cfb35431ccdda7b01e1ea953b9d76ad5de483cb6 /MediaBrowser.Common/Json/JsonDefaults.cs | |
| parent | 1f2d73af8e986b945c53a4a8bc1be1124216589e (diff) | |
Fallback to base jsonconverter
Diffstat (limited to 'MediaBrowser.Common/Json/JsonDefaults.cs')
| -rw-r--r-- | MediaBrowser.Common/Json/JsonDefaults.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MediaBrowser.Common/Json/JsonDefaults.cs b/MediaBrowser.Common/Json/JsonDefaults.cs index 3f74c896f..bbdd1029a 100644 --- a/MediaBrowser.Common/Json/JsonDefaults.cs +++ b/MediaBrowser.Common/Json/JsonDefaults.cs @@ -29,10 +29,14 @@ namespace MediaBrowser.Common.Json NumberHandling = JsonNumberHandling.AllowReadingFromString }; + // Get built-in converters for fallback converting. + var baseNullableInt32Converter = (JsonConverter<int?>)options.GetConverter(typeof(int?)); + var baseNullableInt64Converter = (JsonConverter<long?>)options.GetConverter(typeof(long?)); + options.Converters.Add(new JsonGuidConverter()); options.Converters.Add(new JsonStringEnumConverter()); - options.Converters.Add(new JsonNullableInt32Converter()); - options.Converters.Add(new JsonNullableInt64Converter()); + options.Converters.Add(new JsonNullableInt32Converter(baseNullableInt32Converter)); + options.Converters.Add(new JsonNullableInt64Converter(baseNullableInt64Converter)); return options; } |
