Skip to content

Commit

Permalink
Merge pull request #10 from fossapps/fixes
Browse files Browse the repository at this point in the history
fix(api): serialize enums as string
  • Loading branch information
cyberhck authored Jul 11, 2020
2 parents f7c9ffd + 248227b commit 7ddae9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Feature.Manager.Api/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.Json.Serialization;
using Feature.Manager.Api.StartupExtensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -23,7 +24,10 @@ public void ConfigureServices(IServiceCollection services)
services.AddMetrics();
services.ConfigureRequiredDependencies();
services.ConfigureHealthChecks();
services.AddControllers();
services.AddControllers().AddJsonOptions(x =>
{
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
services.ConfigureSwagger();
services.RegisterWorker();
}
Expand Down

0 comments on commit 7ddae9f

Please sign in to comment.