Skip to content

Commit

Permalink
due to a breaking change, had to revert json serialization naming con…
Browse files Browse the repository at this point in the history
…vention. see: aspnet/Mvc#4842
  • Loading branch information
attilaersek committed Oct 28, 2016
1 parent eb98eb7 commit f683782
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Slamby.API/Startup.cs
Expand Up @@ -31,6 +31,7 @@
using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using Newtonsoft.Json.Serialization;

namespace Slamby.API
{
Expand Down Expand Up @@ -269,7 +270,12 @@ private void ConfigureMvc(IServiceCollection services)
mvcBuilder.AddMvcOptions(o => o.Filters.Add(typeof(ThrottleActionFilter)));
}

mvcBuilder.AddJsonOptions(o => o.SerializerSettings.Converters.Add(new StringEnumConverter()));
mvcBuilder.AddJsonOptions(o =>
{
o.SerializerSettings.Converters.Add(new StringEnumConverter());
//HACK: see https://github.com/aspnet/Mvc/issues/4842
o.SerializerSettings.ContractResolver = new DefaultContractResolver();
});

services.AddRouting(routeOptions =>
{
Expand Down

0 comments on commit f683782

Please sign in to comment.