diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-22 03:01:40 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-22 03:01:40 -0400 |
commit | 86d4827df211cc28549acb88ee7cb08d6cc4d4aa (patch) | |
tree | cfe021ee92fb8312b12ca83eda8575e4271cf8a6 /src/StardewModdingAPI.Web/Startup.cs | |
parent | 399b98b36b6111d364702b117fff3c5f21b8783a (diff) | |
download | SMAPI-86d4827df211cc28549acb88ee7cb08d6cc4d4aa.tar.gz SMAPI-86d4827df211cc28549acb88ee7cb08d6cc4d4aa.tar.bz2 SMAPI-86d4827df211cc28549acb88ee7cb08d6cc4d4aa.zip |
simplify input & output format (#336)
Diffstat (limited to 'src/StardewModdingAPI.Web/Startup.cs')
-rw-r--r-- | src/StardewModdingAPI.Web/Startup.cs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/StardewModdingAPI.Web/Startup.cs b/src/StardewModdingAPI.Web/Startup.cs index 2d9a95f1..abae06ec 100644 --- a/src/StardewModdingAPI.Web/Startup.cs +++ b/src/StardewModdingAPI.Web/Startup.cs @@ -1,12 +1,9 @@ -using System.Linq; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Newtonsoft.Json; -using StardewModdingAPI.Web.Framework; namespace StardewModdingAPI.Web { @@ -40,17 +37,8 @@ namespace StardewModdingAPI.Web public void ConfigureServices(IServiceCollection services) { services - .AddMvc(options => - { - // add support for comma-delimited parameters - ArrayModelBinderProvider arrayModelBinderProvider = options.ModelBinderProviders.OfType<ArrayModelBinderProvider>().First(); - options.ModelBinderProviders.Insert(options.ModelBinderProviders.IndexOf(arrayModelBinderProvider), new CommaDelimitedModelBinderProvider()); - }) - .AddJsonOptions(options => - { - // suppress null values in JSON responses - options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; - }); + .AddMvc() + .AddJsonOptions(options => options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore); // suppress null values in JSON responses } /// <summary>The method called by the runtime to configure the HTTP request pipeline.</summary> |