Skip to content

Commit 18a9821

Browse files
committed
Add workaround for JustArchiNET/ASF-ui#871
1 parent 4fdb9cb commit 18a9821

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ArchiSteamFarm/IPC/Startup.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
using Microsoft.Extensions.DependencyInjection;
3636
using Microsoft.OpenApi.Models;
3737
using Newtonsoft.Json;
38-
using Newtonsoft.Json.Converters;
3938
using Newtonsoft.Json.Serialization;
4039

4140
namespace ArchiSteamFarm.IPC {
@@ -220,18 +219,20 @@ public void ConfigureServices(IServiceCollection services) {
220219
mvc.AddApiExplorer();
221220
#endif
222221

223-
// Add JSON formatters that will be used as default ones if no specific formatters are asked for
224-
// Fix default contract resolver to use original names and not a camel case and add debugging aid while we're at it
225222
#if NETFRAMEWORK
223+
// Add JSON formatters that will be used as default ones if no specific formatters are asked for
226224
mvc.AddJsonFormatters();
227225

228226
mvc.AddJsonOptions(
229227
#else
230228
mvc.AddNewtonsoftJson(
231229
#endif
232230
options => {
231+
// Fix default contract resolver to use original names and not a camel case
233232
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
234-
options.SerializerSettings.Converters.Add(new StringEnumConverter());
233+
234+
// TODO: Enable this again once ASF-ui adds support in https://github.com/JustArchiNET/ASF-ui/issues/871
235+
//options.SerializerSettings.Converters.Add(new StringEnumConverter());
235236

236237
if (Debugging.IsUserDebugging) {
237238
options.SerializerSettings.Formatting = Formatting.Indented;

0 commit comments

Comments
 (0)