Skip to content

Commit

Permalink
update DependencyInjection/AddControllers
Browse files Browse the repository at this point in the history
  • Loading branch information
junioranheu authored Oct 30, 2024
1 parent a5b4985 commit 816ca1d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Auth.API/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ private static void AddControllers(IServiceCollection services)
AddJsonOptions(x =>
{
x.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles;
x.JsonSerializerOptions.WriteIndented = true;
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());

#if DEBUG
x.JsonSerializerOptions.WriteIndented = true;
#else
x.JsonSerializerOptions.WriteIndented = false;
#endif
});
}

Expand All @@ -66,4 +71,4 @@ private static void AddMisc(IServiceCollection services)
services.AddMemoryCache();
services.AddResponseCaching();
}
}
}

0 comments on commit 816ca1d

Please sign in to comment.